|
|
@@ -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}"
|
|
|
}
|