@@ -15,6 +15,7 @@ pipeline {
1515 PATH = " ${ env.JAVA_HOME} /bin:${ env.PATH} "
1616 SLACK_CHANNEL = ' #apm-agent-java'
171718+ BRANCH_SPECIFIER = " ${ params.branch_specifier} "
1819 }
1920 options {
2021 timeout(time : 3 , unit : ' HOURS' )
@@ -25,10 +26,9 @@ pipeline {
2526
2627 }
2728 parameters {
28- string(name : ' branch_specifier' , defaultValue : ' master ' )
29- booleanParam(name : ' check_branch_ci_status' , defaultValue : true , description : " Check for failing tests in the master branch?" )
29+ string(name : ' branch_specifier' , defaultValue : ' stable ' , description : " What branch to release from? " )
30+ booleanParam(name : ' check_branch_ci_status' , defaultValue : true , description : " Check for failing tests in the given branch (if no stable branch) ?" )
3031 }
31-
3232 stages {
3333 stage(' Initializing' ){
3434 options { skipDefaultCheckout() }
@@ -37,7 +37,7 @@ pipeline {
3737 steps {
3838 gitCheckout(
3939 basedir : " ${ BASE_DIR} " ,
40- branch : ' master ' ,
40+ branch : " ${ BRANCH_SPECIFIER } " ,
4141 repo :
' [email protected] :elastic/apm-agent-java.git' ,
4242 credentialsId : ' f6c7695a-671e-4f4f-a331-acdce44ff9ba' ,
4343 shallow : false
@@ -84,14 +84,19 @@ pipeline {
8484 }
8585 }
8686 }
87- stage(' Check master build status' ) {
88- when { expression { params. check_branch_ci_status } }
89- steps {
90- // If this build is not green: https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/master/
91- whenTrue(! buildStatus(host : ' apm-ci.elastic.co' , job : [' apm-agent-java' , ' apm-agent-java-mbp' , ' master' ], return_boolean : true )) {
92- input(message : " WARNING! The master build is not passing. Do you wish to continue?" )
93- }
94- }
87+ stage(' Check build status' ) {
88+ when {
89+ allOf {
90+ expression { params. check_branch_ci_status }
91+ not { branch ' stable' }
92+ }
93+ }
94+ steps {
95+ // If this build is not green: https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/"${BRANCH_SPECIFIER}"/
96+ whenTrue(! buildStatus(host : ' apm-ci.elastic.co' , job : [' apm-agent-java' , ' apm-agent-java-mbp' , " ${ BRANCH_SPECIFIER} " ], return_boolean : true )) {
97+ input(message : " WARNING! The ${ BRANCH_SPECIFIER} build is not passing. Do you wish to continue?" )
98+ }
99+ }
95100 }
96101 stage(' Require confirmation that CHANGELOG.asciidoc has been updated' ) {
97102 steps {
0 commit comments