From fda205d5688716c0c2a4f8ff334c77b36bf6dbe7 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 6 Jun 2017 13:28:05 -0400 Subject: [PATCH] Allow git-url to be overridden by job 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 --- README.md | 3 +++ jjb/lf-ci-jobs.yaml | 24 +++++++++++++++++++++++- jjb/lf-macros.yaml | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c21ec69..01388fc4 100644 --- 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 diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 0c9bbee5..e32b1db4 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -120,13 +120,24 @@ # 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: @@ -151,8 +162,19 @@ # 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}' diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index f90625e2..ee0bc313 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -160,7 +160,7 @@ scm: - git: credentials-id: '{jenkins-ssh-credential}' - url: '$GIT_URL/$GERRIT_PROJECT' + url: '{git-url}' refspec: '{refspec}' branches: - 'refs/heads/{branch}' -- 2.16.6