fix(ci): use full service name in deploy to match compose service names

SERVICE param is already 'tenant-service' etc., compose services are named
the same. Removing the replace() that was stripping the '-service' suffix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
XuqmGroup 2026-04-25 07:09:41 +08:00
父节点 5bd6d56436
当前提交 193c7906cf

3
Jenkinsfile vendored
查看文件

@ -42,10 +42,9 @@ pipeline {
steps { steps {
withCredentials([sshUserPrivateKey(credentialsId: 'PROD_SSH_KEY', keyFileVariable: 'SSH_KEY')]) { withCredentials([sshUserPrivateKey(credentialsId: 'PROD_SSH_KEY', keyFileVariable: 'SSH_KEY')]) {
script { script {
def svcName = params.SERVICE.replace('-service', '')
def imageName = "${ACR_REGISTRY}/${ACR_NAMESPACE}/${params.SERVICE}:${params.IMAGE_TAG}" def imageName = "${ACR_REGISTRY}/${ACR_NAMESPACE}/${params.SERVICE}:${params.IMAGE_TAG}"
bat """ bat """
ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${PROD_USER}@${PROD_HOST} "docker pull ${imageName} && docker compose -f ${COMPOSE_FILE} up -d --no-deps ${svcName} && docker image prune -f" ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${PROD_USER}@${PROD_HOST} "docker pull ${imageName} && docker compose -f ${COMPOSE_FILE} up -d --no-deps ${params.SERVICE} && docker image prune -f"
""" """
} }
} }