浏览代码

发版报错

18118724055@163.com 1 月之前
父节点
当前提交
27662d1f85
共有 1 个文件被更改,包括 2 次插入 和 0 次删除
  1. 2 0
      Jenkinsfile

+ 2 - 0
Jenkinsfile

@@ -355,6 +355,8 @@ pipeline {
                         // 全部都以swarm 模式启动
                         // 旧栈名为 storlead-api-{profile},改名后需先删掉,否则 10070 端口冲突
                         sshCommand remote: remote, command: "docker stack ls --format '{{.Name}}' | grep -qx 'storlead-api-${params.profile}' && docker stack rm storlead-api-${params.profile} && sleep 20 || true"
+                        // stack yml 声明了 external overlay,不存在则先创建(swarm 作用域)
+                        sshCommand remote: remote, command: "docker network inspect ${ARTIFACTID} >/dev/null 2>&1 || docker network create --driver overlay --attachable ${ARTIFACTID}"
                         sshPut remote: remote, from: "${DEPLOY_NAME}-stack.yml", into: "/docker/sp/${DEPLOY_NAME}-stack.yml"
                         sshCommand remote: remote, command: "docker stack deploy --resolve-image=always --with-registry-auth -c /docker/sp/${DEPLOY_NAME}-stack.yml ${DEPLOY_NAME}"
                     }