diff --git a/Jenkinsfile b/Jenkinsfile index 99e70407b11298945a881b2243b27f941da5ec63..8e5b4e4ca8a237cd83bcbcc047639ed6856284fb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,14 +40,15 @@ def pre_test(){ sh ''' cd ${WKC} - rm -rf * + git checkout develop + git pull + git fetch + git checkout ${CHANGE_BRANCH} + git merge develop cd ${WK} git reset --hard git checkout develop git pull - cd ${WKC} - rm -rf * - mv ${WORKSPACE}/* . cd ${WK} export TZ=Asia/Harbin date diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile index 5c6e60d30f529612ad17a60d9dc9197c48224dd9..aae81c19f41a94874b1044db2fdd5e2950cb21e4 100644 --- a/tests/Jenkinsfile +++ b/tests/Jenkinsfile @@ -7,12 +7,12 @@ def pre_test(){ sh ''' cd ${WKC} git reset --hard - git checkout ${BRANCH} + git checkout $BRANCH_NAME git pull git submodule update cd ${WK} git reset --hard - git checkout ${BRANCH} + git checkout $BRANCH_NAME git pull export TZ=Asia/Harbin date @@ -28,7 +28,7 @@ def pre_test(){ pipeline { agent none environment{ - BRANCH = $branch_name + WK = '/var/lib/jenkins/workspace/TDinternal' WKC= '/var/lib/jenkins/workspace/TDinternal/community' }