[Asterisk-code-review] CI: Final version of setting correct gerrit creds (asterisk[master])

George Joseph asteriskteam at digium.com
Thu Aug 16 13:33:25 CDT 2018


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/9913


Change subject: CI:  Final version of setting correct gerrit creds
......................................................................

CI:  Final version of setting correct gerrit creds

Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3
---
M tests/CI/gates.jenkinsfile
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/13/9913/1

diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index c23114b..c67e855 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -68,7 +68,6 @@
 					stage ("Checkout") {
 						sh "sudo chown -R jenkins:users ."  
 						env.GERRIT_PROJECT_URL = env.GERRIT_CHANGE_URL.replaceAll(/\/[0-9]+$/, "/${env.GERRIT_PROJECT}")
-						sh "printenv | sort"
 					
 						/*
 						 * Jenkins has already automatically checked out the base branch
@@ -83,8 +82,10 @@
 						 * We need to retrieve the jenkins2 gerrit https credentials
 						 * in case this review is in a restricted project.
 						 */
-						withCredentials([usernamePassword(credentialsId: env.JENKINS_GERRIT_CREDS,
-							usernameVariable: 'gerrit_user')]) {
+						withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}",
+							passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) {
+
+							sh "printenv | sort"
 
 							checkout scm: [$class: 'GitSCM',
 								branches: [[name: env.GERRIT_BRANCH ]],
@@ -112,7 +113,7 @@
 									credentialsId: env.JENKINS_GERRIT_CREDS,
 									name: env.GERRIT_NAME,
 									refspec: env.GERRIT_REFSPEC,
-									url: env.GERRIT_PROJECT_URL.replaceAll("http(s)?://", "http\$1://${gerrit_user}@")
+									url: env.GERRIT_PROJECT_URL.replaceAll("http(s)?://", "http\$1://${GERRIT_USER_NAME}@")
 									]
 								]
 							]

-- 
To view, visit https://gerrit.asterisk.org/9913
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3
Gerrit-Change-Number: 9913
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180816/6fef13fe/attachment.html>


More information about the asterisk-code-review mailing list