From dd3e1a9e50d72cf254eff331d49b47d6225db2eb Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 20 Oct 2020 17:12:17 +0800 Subject: [PATCH] modify Jenkinsfile add branch --- Jenkinsfile | 43 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8a380c46df..a603dec841 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,14 +8,11 @@ pipeline { stages { stage('pre build'){ agent{label 'master'} + when{ changeset "develop"} steps{ sh ''' - cd ${WKC} - td=`git diff develop remotes/origin/develop` - if [ ! $td ];then - echo "no changes,skip build" - exit 0 - fi + + echo "check OK!" ''' } @@ -23,16 +20,10 @@ pipeline { stage('Parallel test stage') { parallel { stage('pytest') { + when{ changeset "develop"} agent{label 'master'} steps { sh ''' - cd ${WKC} - td=`git diff develop remotes/origin/develop` - if [ ! $td ];then - echo "no changes,skip build" - exit 0 - fi - date cd ${WKC} git checkout develop @@ -55,19 +46,14 @@ pipeline { } } stage('test_b1') { + when{ changeset "develop"} agent{label '184'} steps { sh ''' - cd ${WKC} - td=`git diff develop remotes/origin/develop` - if [ ! $td ];then - echo "no changes,skip build" - exit 0 - fi - date cd ${WKC} git checkout develop git pull + git submodule update cd ${WK} git checkout develop @@ -88,17 +74,13 @@ pipeline { stage('test_crash_gen') { agent{label "185"} + when{ changeset "develop"} steps { sh ''' - cd ${WKC} - td=`git diff develop remotes/origin/develop` - if [ ! $td ];then - echo "no changes,skip build" - exit 0 - fi cd ${WKC} git checkout develop git pull + git submodule update cd ${WK} git checkout develop @@ -122,18 +104,13 @@ pipeline { stage('test_valgrind') { agent{label "186"} + when{ changeset "develop"} steps { sh ''' - cd ${WKC} - td=`git diff develop remotes/origin/develop` - if [ ! $td ];then - echo "no changes,skip build" - exit 0 - fi - date cd ${WKC} git checkout develop git pull + git submodule update cd ${WK} git checkout develop -- GitLab