Merge branch 'dev' of https://gitee.com/justop/hxops into dev
This commit is contained in:
commit
b1905c56cc
1 file changed
+5
-5
Vendored
+5
-5
@@ -215,13 +215,13 @@ pipeline {
|
|||||||
stage('Deploy Test') {
|
stage('Deploy Test') {
|
||||||
when {
|
when {
|
||||||
expression {
|
expression {
|
||||||
// test 分支部署到 test 环境 / test branch deploys to test environment
|
// test / env 分支均部署到 test 环境主机;代码与当前构建分支一致(不再强制 origin/test)
|
||||||
(env.BRANCH_NAME == 'test') &&
|
(env.BRANCH_NAME == 'test' || env.BRANCH_NAME == 'env') &&
|
||||||
(env.FRONTEND_CHANGED == 'true' || env.BACKEND_CHANGED == 'true' || env.DEPLOY_CONFIG_CHANGED == 'true')
|
(env.FRONTEND_CHANGED == 'true' || env.BACKEND_CHANGED == 'true' || env.DEPLOY_CONFIG_CHANGED == 'true')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
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私钥部署到测试服务器
|
// 使用Jenkins中的SSH_TEST_DEPLOY私钥部署到测试服务器
|
||||||
// Use SSH_TEST_DEPLOY credential to deploy to test server
|
// Use SSH_TEST_DEPLOY credential to deploy to test server
|
||||||
@@ -233,8 +233,8 @@ pipeline {
|
|||||||
cd ${TEST_DEPLOY_ROOT}
|
cd ${TEST_DEPLOY_ROOT}
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git checkout -B test origin/test
|
git checkout -B ${BRANCH_NAME} origin/${BRANCH_NAME}
|
||||||
git reset --hard origin/test
|
git reset --hard "origin/${BRANCH_NAME}"
|
||||||
chmod +x scripts/deploy_compose.sh scripts/healthcheck.sh
|
chmod +x scripts/deploy_compose.sh scripts/healthcheck.sh
|
||||||
./scripts/deploy_compose.sh test "" "" ${FRONTEND_CHANGED} ${BACKEND_CHANGED} ${DEPLOY_CONFIG_CHANGED}
|
./scripts/deploy_compose.sh test "" "" ${FRONTEND_CHANGED} ${BACKEND_CHANGED} ${DEPLOY_CONFIG_CHANGED}
|
||||||
'
|
'
|
||||||
|
|||||||
Reference in new issue
Block a user