fix changing targe branch

This commit is contained in:
liuyq-617 2021-04-07 09:20:32 +08:00
parent 136f0a184b
commit 1d1c987bac
1 changed files with 11 additions and 2 deletions

13
Jenkinsfile vendored
View File

@ -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