更新公司图片
This commit is contained in:
Vendored
+12
-3
@@ -59,7 +59,6 @@ pipeline {
|
||||
dir("projects/${imageName}") {
|
||||
withDockerRegistry(credentialsId: 'DockerNexus', url: "http://${REGISTRY}") {
|
||||
sh "docker build -t ${REGISTRY}/${imageName}:${imageTag} ."
|
||||
sh "docker push ${REGISTRY}/${imageName}:${imageTag}"
|
||||
// 同时打 latest 方便 docker compose pull
|
||||
sh "docker tag ${REGISTRY}/${imageName}:${imageTag} ${REGISTRY}/${imageName}:latest"
|
||||
sh "docker push ${REGISTRY}/${imageName}:latest"
|
||||
@@ -79,12 +78,22 @@ pipeline {
|
||||
'chafangtong' : 'chafangtong',
|
||||
'fangjia' : 'fangjia-coresite',
|
||||
'fangjiapds' : 'fangjia-pds',
|
||||
'fangjiastatic' : 'fangjia-static',
|
||||
'fangjiastatic' : 'fangjia-coresite',
|
||||
'geluke' : 'geluke',
|
||||
'fangjiaopen' : 'fangjia-open'
|
||||
]
|
||||
def serviceNames = [
|
||||
'fangjiabkoff' : 'fangjia-bkoff',
|
||||
'chafangtong' : 'chafangtong',
|
||||
'fangjia' : 'fangjia-coresite',
|
||||
'fangjiapds' : 'fangjia-pds',
|
||||
'fangjiastatic' : 'fangjia-coresite',
|
||||
'geluke' : 'geluke',
|
||||
'fangjiaopen' : 'fangjia-open'
|
||||
]
|
||||
def project = params.PROJECT_NAME
|
||||
def dir = composeDir[project]
|
||||
def serviceName =serviceNames[project]
|
||||
withCredentials([usernamePassword(credentialsId: 'goojia-ssh', usernameVariable: 'SSH_USER', passwordVariable: 'SSH_PASS')]) {
|
||||
sh """
|
||||
sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${DEPLOY_HOST} '
|
||||
@@ -92,7 +101,7 @@ pipeline {
|
||||
# 拉取最新镜像
|
||||
docker compose pull
|
||||
# 重启对应服务(不影响其他服务)
|
||||
docker compose up -d --no-deps --force-recreate ${dir}
|
||||
docker compose up -d --no-deps --force-recreate ${serviceName}
|
||||
# 清理旧镜像
|
||||
docker image prune -f
|
||||
'
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 61 KiB |
Reference in New Issue
Block a user