From 84c7adee52ef37804fc434be6dadf7539ef0c067 Mon Sep 17 00:00:00 2001 From: Yiqing Liu Date: Thu, 4 Feb 2021 18:41:49 +0800 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc1a408755..8952e493db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,6 @@ def abort_previous(){ if (buildNumber > 1) milestone(buildNumber - 1) milestone(buildNumber) } -def kipstage=0 def pre_test(){ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' @@ -46,7 +45,7 @@ def pre_test(){ git pull git fetch origin +refs/pull/${CHANGE_ID}/merge git checkout -qf FETCH_HEAD - git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD develop)|grep -v -E '.*md|.*src/connector|Jenkinsfile' || exit 0 + git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD develop)|grep -v -E '.*md|//src//connector|Jenkinsfile' || exit 0 cd ${WK} git reset --hard HEAD~10 git checkout develop @@ -73,29 +72,12 @@ pipeline { } stages { - stage('pre_build'){ - agent{label 'master'} - steps { - sh''' - cd ${WORKSPACE} - git checkout develop - git pull - git fetch origin +refs/pull/${CHANGE_ID}/merge - git checkout -qf FETCH_HEAD - ''' - script{ - skipstage=sh(script:"git --no-pager diff --name-only FETCH_HEAD develop|grep -v -E '.*md|//src//connector|Jenkinsfile|test-all.sh' || echo 1 ",returnStdout:true) - } - } - } + stage('Parallel test stage') { //only build pr when { changeRequest() - expression { - skipstage == 0 - } } parallel { stage('python_1_s1') { @@ -145,7 +127,7 @@ pipeline { stage('test_b1_s2') { agent{label 'b1'} steps { - timeout(time: 45, unit: 'MINUTES'){ + timeout(time: 90, unit: 'MINUTES'){ pre_test() sh ''' cd ${WKC}/tests @@ -283,7 +265,7 @@ pipeline {
  • 构建结果: Successful
  • 构建编号:${BUILD_NUMBER}
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${CHANGE_TITLE}
  • +
  • 提交信息:${env.CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • @@ -321,7 +303,7 @@ pipeline {
  • 构建结果: Successful
  • 构建编号:${BUILD_NUMBER}
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${CHANGE_TITLE}
  • +
  • 提交信息:${env.CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • -- GitLab