ci: add test environment client deployment

This commit is contained in:
2026-07-30 21:52:18 +08:00
parent 4cef53e842
commit 7ef4639029
5 changed files with 120 additions and 0 deletions
Vendored
+43
View File
@@ -0,0 +1,43 @@
pipeline {
agent any
options {
timestamps()
disableConcurrentBuilds()
}
stages {
stage('确认提交版本') {
steps {
sh 'echo "Jenkins 已拉取 release/test 分支代码"'
sh 'git log -1 --oneline'
}
}
stage('构建并部署测试前端') {
steps {
sh '''
set -eu
docker compose -f docker-compose.test.yml build --pull=false
docker compose -f docker-compose.test.yml up -d --remove-orphans
'''
}
}
stage('部署检查') {
steps {
sh '''
set -eu
docker compose -f docker-compose.test.yml ps
docker compose -f docker-compose.test.yml exec -T client-web wget -qO- http://127.0.0.1/healthz
'''
}
}
}
post {
failure {
sh 'docker compose -f docker-compose.test.yml logs --tail=100 || true'
}
}
}