@@ -5,6 +5,12 @@ def JIRA_ID="";
55def commitMessage= " " ;
66def prResponse= " " ;
77def prNumber;
8+ def props;
9+ def loadProperties () {
10+ node {
11+ props = readProperties file : ' pipeline.properties'
12+ }
13+ }
814def githubAPIUrl= " https://api.github.com/repos/marklogic/marklogic-data-hub"
915pipeline{
1016 agent none;
@@ -27,6 +33,7 @@ pipeline{
2733 agent { label ' dhfLinuxAgent' }
2834 steps{
2935 script{
36+ props = readProperties file :' data-hub/pipeline.properties' ;
3037 if (env. CHANGE_TITLE ){
3138 JIRA_ID = env. CHANGE_TITLE . split(' :' )[0 ];
3239 def transitionInput = [transition : [id : ' 41' ]]
@@ -305,7 +312,7 @@ pipeline{
305312 }
306313 stage(' Parallel Execution' ){
307314 when {
308- branch ' 4.x-develop '
315+ branch props[ ' ExecutionBranch ' ]
309316 beforeAgent true
310317 }
311318 parallel{
@@ -524,7 +531,7 @@ pipeline{
524531 script{
525532 // JIRA_ID=env.CHANGE_TITLE.split(':')[0]
526533 prResponse = sh (returnStdout : true , script :'''
527- curl -u $Credentials -X POST -H 'Content-Type:application/json' -d '{\" title\" : \" Automated PR for Release Branch\" , \" head\" : \" 4.x-develop\" , \" base\" : \" release/4.2.2 \" }' ''' + githubAPIUrl+ ''' /pulls ''' )
534+ curl -u $Credentials -X POST -H 'Content-Type:application/json' -d '{\" title\" : \" Automated PR for Release Branch\" , \" head\" : \" 4.x-develop\" , \" base\" : \" ''' + props[ ' ReleaseBranch ' ] + ''' \" }' ''' + githubAPIUrl+ ''' /pulls ''' )
528535 println (prResponse)
529536 def slurper = new JsonSlurper (). parseText(prResponse)
530537 println (slurper. number)
@@ -560,7 +567,7 @@ pipeline{
560567 }
561568 stage(' Sanity Tests' ){
562569 when {
563- branch ' Release/4.2.2 '
570+ branch props[ ' ReleaseBranch ' ]
564571 beforeAgent true
565572 }
566573 agent { label ' dhfLinuxAgent' }
0 commit comments