From e61df9d8a0179f3e48340599e544a3c42ea8338f Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Fri, 5 Feb 2021 11:32:50 +0800 Subject: [PATCH] cancel build excluded regions stategy --- Jenkinsfile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9dab0d66be..4165f297ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -76,9 +76,27 @@ pipeline { stage('Parallel test stage') { + 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) + } + } + } //only build pr when { changeRequest() + expression { + skipstage == 0 + } } parallel { stage('python_1_s1') { @@ -128,7 +146,7 @@ pipeline { stage('test_b1_s2') { agent{label 'b1'} steps { - timeout(time: 90, unit: 'MINUTES'){ + timeout(time: 45, unit: 'MINUTES'){ pre_test() sh ''' cd ${WKC}/tests @@ -265,7 +283,7 @@ pipeline {
  • 构建结果: Successful
  • 构建编号:${BUILD_NUMBER}
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${env.CHANGE_TITLE}
  • +
  • 提交信息:${CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • @@ -303,7 +321,7 @@ pipeline {
  • 构建结果: Successful
  • 构建编号:${BUILD_NUMBER}
  • 触发用户:${env.CHANGE_AUTHOR}
  • -
  • 提交信息:${env.CHANGE_TITLE}
  • +
  • 提交信息:${CHANGE_TITLE}
  • 构建地址:${BUILD_URL}
  • 构建日志:${BUILD_URL}console
  • -- GitLab