From 1255b90c6274cad38d2beb37d7631722286668e0 Mon Sep 17 00:00:00 2001 From: SameeraPriyathamTadikonda Date: Fri, 1 Feb 2019 15:33:12 -0800 Subject: [PATCH 1/3] Added Automatic Approvals for PR --- Jenkinsfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 528522b4d9..23ab33ed08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -231,9 +231,19 @@ pipeline{ withCredentials([usernameColonPassword(credentialsId: 'a0ec09aa-f339-44de-87c4-1a4936df44f5', variable: 'Credentials')]) { script{ JIRA_ID=env.CHANGE_TITLE.split(':')[0] - sh "curl -u $Credentials -X POST -H 'Content-Type:application/json' -d '{\"title\": \"${JIRA_ID}: Automated PR for Release Branch\" , \"head\": \"IntegrationBranch\" , \"base\": \"ReleaseBranch\" }' https://api.github.com/repos/SameeraPriyathamTadikonda/marklogic-data-hub/pulls" + prResponse = sh (returnStdout: true, script:''' + sh "curl -u $Credentials -X POST -H 'Content-Type:application/json' -d '{\"title\": \"'''+JIRA_ID+''': Automated PR for Release Branch\" , \"head\": \"IntegrationBranch\" , \"base\": \"ReleaseBranch\" }' https://api.github.com/repos/SameeraPriyathamTadikonda/marklogic-data-hub/pulls"''') + println(prResponse) + def slurper = new JsonSlurper().parseText(prResponse) + println(slurper.number) + prNumber=slurper.number; } } + withCredentials([usernameColonPassword(credentialsId: 'rahul-git', variable: 'Credentials')]) { + sh "curl -u $Credentials -X POST -d '{\"event\": \"APPROVE\"}' https://api.github.com/repos/SameeraPriyathamTadikonda/marklogic-data-hub/pulls/${prNumber}/reviews" + } + + } } post{ success { From 888ac0da24d8dba815f97d2d53bd85d45a6f8766 Mon Sep 17 00:00:00 2001 From: SameeraPriyathamTadikonda Date: Fri, 1 Feb 2019 15:35:44 -0800 Subject: [PATCH 2/3] Added Automatic Approvals for PR --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 23ab33ed08..68b7defc23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -254,6 +254,5 @@ pipeline{ println("Creation of Automated PR Failed") } } - } } } \ No newline at end of file From ede2bd0af6f6197c63e3638b144f425ccbd02980 Mon Sep 17 00:00:00 2001 From: SameeraPriyathamTadikonda Date: Fri, 1 Feb 2019 15:36:50 -0800 Subject: [PATCH 3/3] Added Automatic Approvals for PR --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 68b7defc23..3e2f13e34e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -243,7 +243,6 @@ pipeline{ sh "curl -u $Credentials -X POST -d '{\"event\": \"APPROVE\"}' https://api.github.com/repos/SameeraPriyathamTadikonda/marklogic-data-hub/pulls/${prNumber}/reviews" } - } } post{ success { @@ -254,5 +253,6 @@ pipeline{ println("Creation of Automated PR Failed") } } + } } } \ No newline at end of file