From 00563ce21a70ff8cfd2b130b3a75715b999e0dd6 Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@digium.com>
Date: Thu, 16 Aug 2018 12:51:51 -0600
Subject: [PATCH] CI: Fixup for non-13 branches

Change-Id: I5e1d4a09e58b92b541bc8ed6f9e10e54c4e5101f
---
 tests/CI/unittests.jenkinsfile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile
index 332975c2aa..8cf9f4ac59 100644
--- a/tests/CI/unittests.jenkinsfile
+++ b/tests/CI/unittests.jenkinsfile
@@ -69,7 +69,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
@@ -84,8 +83,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 ]],
@@ -113,7 +114,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}@")
 									]
 								]
 							]
-- 
GitLab