diff --git a/Jenkinsfile b/Jenkinsfile index d96eeaa724b975f7b22ed4351d86e98648cf1473..4c9da9a92859e7b5b1a970adc0483491a39ae9cf 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) }