From 1d1c987bac210625c6dccbe0e2e1d275a45c249f Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 7 Apr 2021 09:20:32 +0800 Subject: [PATCH] fix changing targe branch --- Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c64e71f51..25bf86d9cc 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 -- GitLab