Make packer-cloud-env variable configurable 99/5699/3
authorAnil Belur <abelur@linuxfoundation.org>
Mon, 31 Jul 2017 05:30:30 +0000 (15:30 +1000)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 2 Aug 2017 18:49:12 +0000 (18:49 +0000)
The packer-cloud-env can have a default in job templates but we should
allow it to be configurable in case a downstream consumer names their
configuration file differently.

Jira: releng-341
Change-Id: Ifc89dec39d3b93b75df58d8d37c7299a9dccf29d
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
test.template

index e0aee72..1ad02f3 100644 (file)
     ######################
 
     build-timeout: 45
+    packer-cloud-settings: packer-cloud-env
 
     wrappers:
       - lf-infra-wrappers:
 - lf_packer_merge_builders: &lf_packer_merge_builders
     name: lf-packer-merge-builders
     # Adds builders section common to merge packer jobs.
+    # {packer-cloud-settings} is passed from the project, defines the managed
+    #                   file-id name created in Jenkins
+    #                   (default: packer-cloud-env)
+    # {packer-version}: is global defined in job group level, the version number
+    #                   can be updated to install the latest version of packer.
+    # {platforms}:      defines the packer platform file, passed from the project.
+    # {template}:       defines the packer template file, passed from the project.
     builders:
       - lf-infra-packer-validate:
+          packer-cloud-settings: '{packer-cloud-settings}'
           packer-version: '{packer-version}'
       - lf-infra-packer-build:
+          packer-cloud-settings: '{packer-cloud-settings}'
+          packer-version: '{packer-version}'
           platform: '{platforms}'
           template: '{templates}'
-          packer-version: '{packer-version}'
 
 - lf_packer_verify_builders: &lf_packer_verify_builders
     # Adds builders section common to verify packer jobs.
+    # {packer-cloud-settings} is passed from the project, defines the managed
+    #                   file-id name created in Jenkins
+    #                   (default: packer-cloud-env)
+    # {packer-version}: is global defined in job group level, the version number
+    #                   can be updated to install the latest version of packer.
     name: lf-packer-verify-builders
     builders:
       - lf-infra-packer-validate:
+          packer-cloud-settings: '{packer-cloud-settings}'
           packer-version: '{packer-version}'
 
 - parameter:
index 7d3e121..7d2cd98 100644 (file)
@@ -76,7 +76,7 @@
     builders:
       - config-file-provider:
           files:
-            - file-id: packer-cloud-env
+            - file-id: '{packer-cloud-settings}'
               variable: CLOUDENV
       - inject:
           properties-content: |
@@ -94,7 +94,7 @@
     builders:
       - config-file-provider:
           files:
-            - file-id: 'packer-cloud-env'
+            - file-id: '{packer-cloud-settings}'
               variable: 'CLOUDENV'
       - inject:
           properties-content: |
index 7ff5c07..81bd907 100644 (file)
@@ -48,6 +48,7 @@
     jobs:
         - "{project-name}-packer-jobs"
 
+    packer-cloud-settings: ci-packer-cloud-env
     project-name: gerrit-ciman
     platforms:
       - centos
@@ -89,6 +90,7 @@
     jobs:
         - "{project-name}-github-packer-jobs"
 
+    packer-cloud-settings: ci-packer-cloud-env
     project-name: github-ciman
     platforms:
       - centos