Allow git-url to be overridden by job 01/5101/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 6 Jun 2017 17:28:05 +0000 (13:28 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 7 Jun 2017 01:34:12 +0000 (21:34 -0400)
This is needed for jobs that want to trigger against cross-project
Git systems such as global-jjb and lftools.

Change-Id: I28035e22532c1e81e363e59a5e57a1b09b5ae1b8
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
README.md
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml

index 4c21ec6..01388fc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -131,6 +131,9 @@ Required parameters:
 Optional parameters:
 
 **branch**: is the git branch to build from.
+**git-url**: is used to override the GIT_URL environment variable. Should not
+             be necessary in most cases. Mainly used by LF projects such as
+             global-jjb and lftools.
 **jjb-version**: is the version of JJB to install in the build minion.
 
 ## Archiving logs in Jobs
index 0c9bbee..e32b1db 100644 (file)
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_merge_builders
 
+    ######################
+    # Default parameters #
+    ######################
+
+    git-url: '$GIT_URL/$GERRIT_PROJECT'
+
+    #####################
+    # Job Configuration #
+    #####################
+
     scm:
       - lf-infra-gerrit-scm:
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          git-url: '{git-url}'
           refspec: ''
           branch: '{branch}'
           submodule-recursive: '{submodule-recursive}'
           choosing-strategy: default
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
     triggers:
       - gerrit:
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_verify_builders
 
+    ######################
+    # Default parameters #
+    ######################
+
+    git-url: '$GIT_URL/$GERRIT_PROJECT'
+
+    #####################
+    # Job Configuration #
+    #####################
+
     scm:
       - lf-infra-gerrit-scm:
+          git-url: '{git-url}'
           refspec: '$GERRIT_REFSPEC'
           branch: '$GERRIT_BRANCH'
           submodule-recursive: '{submodule-recursive}'
index f90625e..ee0bc31 100644 (file)
     scm:
       - git:
           credentials-id: '{jenkins-ssh-credential}'
-          url: '$GIT_URL/$GERRIT_PROJECT'
+          url: '{git-url}'
           refspec: '{refspec}'
           branches:
             - 'refs/heads/{branch}'