CI: Update jenkinsfiles with new Gerrit URLs
authorGeorge Joseph <gjoseph@digium.com>
Wed, 27 Feb 2019 16:37:14 +0000 (09:37 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 27 Feb 2019 16:56:33 +0000 (10:56 -0600)
The recent upgrade of Gerrit to 2.16 elimiated referencing a
repository in a way the jenkinsfiles were relying on so
the URL references were changed to a more consistent and supported
format.

Change-Id: I2e8e3f213b9a96bb1b27665eca4a9a24bc49820e
(cherry picked from commit 5ce084579f897096163b4e0c2ed4e8e1a8558cca)

tests/CI/gates.jenkinsfile
tests/CI/unittests.jenkinsfile

index 8e24cf3..bc23781 100644 (file)
@@ -79,7 +79,7 @@ pipeline {
 
                                        stage ("Checkout") {
                                                sh "sudo chown -R jenkins:users ."  
-                                               env.GERRIT_PROJECT_URL = env.GERRIT_CHANGE_URL.replaceAll(/\/[0-9]+$/, "/${env.GERRIT_PROJECT}")
+                                               env.GERRIT_PROJECT_URL = env.GIT_URL.replaceAll(/[^\/]+$/, env.GERRIT_PROJECT)
                                        
                                                /*
                                                 * Jenkins has already automatically checked out the base branch
@@ -102,10 +102,10 @@ pipeline {
                                                        checkout scm: [$class: 'GitSCM',
                                                                branches: [[name: env.GERRIT_BRANCH ]],
                                                                extensions: [
-                                                                       [$class: 'ScmName', name: 'gerrit-public'],
+                                                                       [$class: 'ScmName', name: env.GERRIT_NAME],
                                                                        [$class: 'CleanBeforeCheckout'],
                                                                        [$class: 'PreBuildMerge', options: [
-                                                                               mergeRemote: 'gerrit-public',
+                                                                               mergeRemote: env.GERRIT_NAME,
                                                                                fastForwardMode: 'NO_FF',
                                                                                mergeStrategy: 'RECURSIVE',
                                                                                mergeTarget: env.GERRIT_BRANCH]],
index 5043139..3961cf5 100644 (file)
@@ -80,7 +80,7 @@ pipeline {
 
                                        stage ("Checkout") {
                                                sh "sudo chown -R jenkins:users ."
-                                               env.GERRIT_PROJECT_URL = env.GERRIT_CHANGE_URL.replaceAll(/\/[0-9]+$/, "/${env.GERRIT_PROJECT}")
+                                               env.GERRIT_PROJECT_URL = env.GIT_URL.replaceAll(/[^\/]+$/, env.GERRIT_PROJECT)
 
                                                /*
                                                 * Jenkins has already automatically checked out the base branch
@@ -103,10 +103,10 @@ pipeline {
                                                        checkout scm: [$class: 'GitSCM',
                                                                branches: [[name: env.GERRIT_BRANCH ]],
                                                                extensions: [
-                                                                       [$class: 'ScmName', name: 'gerrit-public'],
+                                                                       [$class: 'ScmName', name: env.GERRIT_NAME],
                                                                        [$class: 'CleanBeforeCheckout'],
                                                                        [$class: 'PreBuildMerge', options: [
-                                                                               mergeRemote: 'gerrit-public',
+                                                                               mergeRemote: env.GERRIT_NAME,
                                                                                fastForwardMode: 'NO_FF',
                                                                                mergeStrategy: 'RECURSIVE',
                                                                                mergeTarget: env.GERRIT_BRANCH]],