]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
CI: Use proper credentials for Security testsuite checkout
authorGeorge Joseph <gjoseph@digium.com>
Fri, 14 Sep 2018 17:31:28 +0000 (11:31 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 14 Sep 2018 17:31:28 +0000 (11:31 -0600)
Can't do anonymous http checkout from Security-testsuite.
Need to use same credentials as the gerrit review checkout.

Change-Id: I87af68c995cb8926f5e87f9af245600d76984f05

tests/CI/gates.jenkinsfile

index c67e8554328ccfc392624b71e47b4ab1b4dced57..19c82e8866e2cf7f20d0b1bea9a952cc76c60ae2 100644 (file)
@@ -170,8 +170,10 @@ pipeline {
 
                                                                        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 @@ pipeline {
                                                                                                        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}'"