diff --git a/Jenkinsfile b/Jenkinsfile index 2c64e71f5112dca47fdb7cb3c2f1b5c85923b550..25bf86d9cc031dc8cfe12d071f933ed5bacd3acd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,8 +42,17 @@ def pre_test(){ killall -9 taosd ||echo "no taosd running" killall -9 gdb || echo "no gdb running" cd ${WKC} - git reset --hard HEAD~10 >/dev/null - git checkout develop + git reset --hard HEAD~10 >/dev/null + ''' + script { + if (env.CHANGE_TARGET == 'master') { + sh 'git checkout master' + } + else { + sh 'git checkout develop' + } + } + sh''' git pull >/dev/null git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD