Make Github url and clone url at Jenkins level. 23/5023/8
authorJeremy Phelps <jphelps@linuxfoundation.org>
Tue, 30 May 2017 16:40:41 +0000 (11:40 -0500)
committerJeremy Phelps <jphelps@linuxfoundation.org>
Tue, 6 Jun 2017 19:31:12 +0000 (14:31 -0500)
Provide a way to access Github url and Github clone url.
Github url and clone url will be set at global level in Jenkins;
GIT_URL and GIT_CLONE_URL respectively.

JIRA: RELENG-151
Change-Id: I2fdc509b27d97816aab2168a6a7863d295c3dd8a
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
README.md
jjb/lf-ci-jobs.yaml

index 4c21ec6..4236715 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,11 +11,15 @@ For example:
 
 ```
 GIT_URL=ssh://jenkins-$SILO@git.opendaylight.org:29418
+GIT_CLONE_URL=git@github.com:
 JENKINS_HOSTNAME=jenkins092
 LOGS_SERVER=https://logs.opendaylight.org
 NEXUS_URL=https://nexus.opendaylight.org
 SILO=releng
 ```
+Note: **GIT_CLONE_URL** is only used by Github projects as this
+will be different from the URL used the poperties
+configuration.
 
 ## Jenkins Plugin Requirements
 
@@ -74,11 +78,9 @@ Trigger global configuration.
 **jenkins-ssh-credential**: The name of the Jenkins Credential to use for ssh
 connections.
 
-If you are using GitHub then there are two more parameters which
+If you are using GitHub then there is one more parameter which
 will need to be placed in the defaults.yaml
 
-**github-url**: The URL of GitHub. (Default: https://github.com)
-
 **github-org**: The name of the GitHub organization.
 
 defaults.yaml:
index 03db349..861c4ca 100644 (file)
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_merge_builders
 
-    ######################
-    # Default parameters #
-    ######################
-
-    github-url: https://github.com
-
     #####################
     # Job Configuration #
     #####################
 
     properties:
       - github:
-          url: '{github-url}/{github-org}/{project}'
+          url: '${{GIT_URL}}{github-org}/{project}'
 
     scm:
       - lf-infra-github-scm:
-          url: 'git@github.com:{github-org}/{project}'
+          url: '${{GIT_CLONE_URL}}{github-org}/{project}'
           refspec: ''
           branch: '{branch}'
           submodule-recursive: '{submodule-recursive}'
     # yamllint disable-line rule:key-duplicates
     <<: *lf_jjb_merge_builders
 
-    ######################
-    # Default parameters #
-    ######################
-
-    github-url: https://github.com
-
     #####################
     # Job Configuration #
     #####################
 
     properties:
       - github:
-          url: '{github-url}/{github-org}/{project}'
+          url: '${{GIT_URL}}{github-org}/{project}'
 
     scm:
       - lf-infra-github-scm:
-          url: 'git@github.com:{github-org}/{project}'
+          url: '${{GIT_CLONE_URL}}{github-org}/{project}'
           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
           branch: '{branch}'
           submodule-recursive: '{submodule-recursive}'