no message

This commit is contained in:
2025-09-11 18:50:55 +08:00
parent 9e90145ced
commit bf4c37e0d1
5 changed files with 23 additions and 121 deletions

9
Jenkinsfile vendored
View File

@ -4,7 +4,7 @@ pipeline {
// maven 'M3' // 必须在 Jenkins → Manage Jenkins → Global Tool Configuration 中配置过
// }
environment {
APP_NAME = "sczx_singlepay"
APP_NAME = "sczx-singlepay"
DOCKER_IMAGE = "${APP_NAME}:latest"
CONTAINER_NAME = "${APP_NAME}-container"
}
@ -49,9 +49,9 @@ pipeline {
steps {
echo "🛑 正在停止旧的容器(如果存在)..."
sh '''
if [ "$(docker ps -f 'name=sczx_singlepay-container' --format '{{.Status}}')" ]; then
docker stop sczx_singlepay-container
docker rm sczx_singlepay-container
if [ "$(docker ps -f 'name=sczx-singlepay-container' --format '{{.Status}}')" ]; then
docker stop sczx-singlepay-container
docker rm sczx-singlepay-container
fi
'''
}
@ -70,6 +70,7 @@ pipeline {
-e TZ=Asia/Shanghai \
-v /etc/localtime:/etc/localtime:ro \
-v /root/cert:/root/cert:ro \
-v /sczx/logs/singlepay:/sczx/logs/singlepay:rw \
--restart always \
\${DOCKER_IMAGE}
"""