Skip to content

Commit 8ab4ef8

Browse files
SameeraPriyathamTadikondaMarkLogic Builder
authored andcommitted
Added properties
1 parent 4c18f48 commit 8ab4ef8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Jenkinsfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ def JIRA_ID="";
55
def commitMessage="";
66
def prResponse="";
77
def prNumber;
8+
def props;
9+
def loadProperties() {
10+
node {
11+
props = readProperties file: 'pipeline.properties'
12+
}
13+
}
814
def githubAPIUrl="https://api.github.com/repos/marklogic/marklogic-data-hub"
915
pipeline{
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'}

pipeline.propertie

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ReleaseBranch:release/4.3.2
2+
ExecutionBranch:4.x-develop

0 commit comments

Comments
 (0)