Merge branch 'dev' of https://gitee.com/justop/hxops into dev

This commit is contained in:
runny committed 2026-05-18 09:25:02 +08:00
commit b1905c56cc
1 file changed
+5 -5
Vendored
+5 -5
View File
@@ -215,13 +215,13 @@ pipeline {
stage('Deploy Test') {
when {
expression {
// test 分支部署到 test 环境 / test branch deploys to test environment
(env.BRANCH_NAME == 'test') &&
// test / env 分支均部署到 test 环境主机;代码与当前构建分支一致(不再强制 origin/test)
(env.BRANCH_NAME == 'test' || env.BRANCH_NAME == 'env') &&
(env.FRONTEND_CHANGED == 'true' || env.BACKEND_CHANGED == 'true' || env.DEPLOY_CONFIG_CHANGED == 'true')
}
}
steps {
echo "[Deploy Test] start host=${env.TEST_DEPLOY_HOST}"
echo "[Deploy Test] start branch=${env.BRANCH_NAME} host=${env.TEST_DEPLOY_HOST}"
// 使用Jenkins中的SSH_TEST_DEPLOY私钥部署到测试服务器
// Use SSH_TEST_DEPLOY credential to deploy to test server
@@ -233,8 +233,8 @@ pipeline {
cd ${TEST_DEPLOY_ROOT}
git fetch origin
git reset --hard HEAD
git checkout -B test origin/test
git reset --hard origin/test
git checkout -B ${BRANCH_NAME} origin/${BRANCH_NAME}
git reset --hard "origin/${BRANCH_NAME}"
chmod +x scripts/deploy_compose.sh scripts/healthcheck.sh
./scripts/deploy_compose.sh test "" "" ${FRONTEND_CHANGED} ${BACKEND_CHANGED} ${DEPLOY_CONFIG_CHANGED}
'