From ba76fe9897ea71c67c14f307723fb0185226d2d1 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 6 Apr 2021 16:13:11 +0800 Subject: [PATCH] [TD-3671]change target branch --- Jenkinsfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d96eeaa724..4c9da9a928 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,16 @@ def pre_test(){ find ${WKC}/tests/pytest -name \'*\'.sql -exec rm -rf {} \\; cd ${WK} git reset --hard HEAD~10 - git checkout develop + ''' + script { + if (env.CHANGE_TARGET == 'master') { + sh 'git checkout master' + } + else { + sh 'git checkout develop' + } + } + sh ''' git pull >/dev/null cd ${WK} export TZ=Asia/Harbin @@ -86,7 +95,8 @@ pipeline { git pull git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD - ''' + ''' + script{ env.skipstage=sh(script:"cd ${WORKSPACE}.tes && git --no-pager diff --name-only FETCH_HEAD develop|grep -v -E '.*md|//src//connector|Jenkinsfile|test-all.sh' || echo 0 ",returnStdout:true) } -- GitLab