更新公司图片

This commit is contained in:
王文艳
2026-05-20 08:16:04 +08:00
parent 5f26f3df88
commit 66a9819b8c
2 changed files with 12 additions and 3 deletions
Vendored
+12 -3
View File
@@ -59,7 +59,6 @@ pipeline {
dir("projects/${imageName}") { dir("projects/${imageName}") {
withDockerRegistry(credentialsId: 'DockerNexus', url: "http://${REGISTRY}") { withDockerRegistry(credentialsId: 'DockerNexus', url: "http://${REGISTRY}") {
sh "docker build -t ${REGISTRY}/${imageName}:${imageTag} ." sh "docker build -t ${REGISTRY}/${imageName}:${imageTag} ."
sh "docker push ${REGISTRY}/${imageName}:${imageTag}"
// 同时打 latest 方便 docker compose pull // 同时打 latest 方便 docker compose pull
sh "docker tag ${REGISTRY}/${imageName}:${imageTag} ${REGISTRY}/${imageName}:latest" sh "docker tag ${REGISTRY}/${imageName}:${imageTag} ${REGISTRY}/${imageName}:latest"
sh "docker push ${REGISTRY}/${imageName}:latest" sh "docker push ${REGISTRY}/${imageName}:latest"
@@ -79,12 +78,22 @@ pipeline {
'chafangtong' : 'chafangtong', 'chafangtong' : 'chafangtong',
'fangjia' : 'fangjia-coresite', 'fangjia' : 'fangjia-coresite',
'fangjiapds' : 'fangjia-pds', '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', 'geluke' : 'geluke',
'fangjiaopen' : 'fangjia-open' 'fangjiaopen' : 'fangjia-open'
] ]
def project = params.PROJECT_NAME def project = params.PROJECT_NAME
def dir = composeDir[project] def dir = composeDir[project]
def serviceName =serviceNames[project]
withCredentials([usernamePassword(credentialsId: 'goojia-ssh', usernameVariable: 'SSH_USER', passwordVariable: 'SSH_PASS')]) { withCredentials([usernamePassword(credentialsId: 'goojia-ssh', usernameVariable: 'SSH_USER', passwordVariable: 'SSH_PASS')]) {
sh """ sh """
sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${DEPLOY_HOST} ' sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${DEPLOY_HOST} '
@@ -92,7 +101,7 @@ pipeline {
# 拉取最新镜像 # 拉取最新镜像
docker compose pull 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 docker image prune -f
' '
Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 61 KiB