From 62f4a09d5d8bd2564b07276e4b38d9a12c9647e3 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Mon, 21 Dec 2020 15:52:20 +0800 Subject: [PATCH] fix jenkinsfile error --- Jenkinsfile | 9 +++++---- tests/Jenkinsfile | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 99e70407b1..8e5b4e4ca8 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 5c6e60d30f..aae81c19f4 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' } -- GitLab