[Asterisk-code-review] CI: Use proper credentials for Security testsuite checkout (asterisk[16])

George Joseph asteriskteam at digium.com
Fri Sep 14 14:15:09 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10145 )

Change subject: CI: Use proper credentials for Security testsuite checkout
......................................................................

CI: Use proper credentials for Security testsuite checkout

Can't do anonymous http checkout from Security-testsuite.
Need to use same credentials as the gerrit review checkout.

Change-Id: I87af68c995cb8926f5e87f9af245600d76984f05
---
M tests/CI/gates.jenkinsfile
1 file changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index c67e855..19c82e8 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -170,8 +170,10 @@
 
 									sh "sudo rm -rf ${groupDir} || : "
 									
-									checkout scm: [$class: 'GitSCM',
-										branches: [[name: "${BRANCH_NAME}"]],
+									withCredentials([usernamePassword(credentialsId: "${JENKINS_GERRIT_CREDS}",
+										passwordVariable: 'GERRIT_USER_PW', usernameVariable: 'GERRIT_USER_NAME')]) {
+										checkout scm: [$class: 'GitSCM',
+											branches: [[name: "${BRANCH_NAME}"]],
 											extensions: [
 												[$class: 'RelativeTargetDirectory', relativeTargetDir: groupDir],
 												[$class: 'CloneOption',
@@ -181,8 +183,12 @@
 													shallow: true
 												],
 											],
-											userRemoteConfigs: [[name: env.GERRIT_NAME, url: testsuiteUrl]]
+											userRemoteConfigs: [[
+												name: env.GERRIT_NAME,
+												url: testsuiteUrl,replaceAll("http(s)?://", "http\$1://${GERRIT_USER_NAME}@")
+											]]
 										]
+									}
 
 									sh "sudo tests/CI/runTestsuite.sh --testsuite-dir='${groupDir}' --testsuite-command='${groupTestcmd}'"
 

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I87af68c995cb8926f5e87f9af245600d76984f05
Gerrit-Change-Number: 10145
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180914/1204dc86/attachment.html>


More information about the asterisk-code-review mailing list