]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
CI: Final version of setting correct gerrit creds
authorGeorge Joseph <gjoseph@digium.com>
Thu, 16 Aug 2018 18:28:03 +0000 (12:28 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Thu, 16 Aug 2018 18:32:19 +0000 (12:32 -0600)
Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3

tests/CI/gates.jenkinsfile

index c23114b211a464c22381dd585fed6e8eed07ebae..c67e8554328ccfc392624b71e47b4ab1b4dced57 100644 (file)
@@ -68,7 +68,6 @@ pipeline {
                                        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 @@ pipeline {
                                                 * 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 @@ pipeline {
                                                                        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}@")
                                                                        ]
                                                                ]
                                                        ]