diff --git a/Jenkinsfile b/Jenkinsfile index 536cbe73a29510bcab57e7f906c024ceba37076a..0d13a212121e27aad89ffb06eb85a91a1acf7a32 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,6 +31,7 @@ def abort_previous(){ if (buildNumber > 1) milestone(buildNumber - 1) milestone(buildNumber) } +def kipstage=0 def pre_test(){ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' @@ -72,12 +73,29 @@ 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') { @@ -127,7 +145,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 @@ -245,7 +263,7 @@ pipeline { success { emailext ( subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: ''' + body: """ @@ -261,7 +279,7 @@ pipeline {