From: Anil Belur Date: Mon, 31 Jul 2017 05:30:30 +0000 (+1000) Subject: Make packer-cloud-env variable configurable X-Git-Tag: v0.6.0~1^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=11679542b3d7adde0a37c894a7422f72311c8c66;p=releng%2Fglobal-jjb.git Make packer-cloud-env variable configurable 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 --- diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index e0aee723..1ad02f35 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -111,6 +111,7 @@ ###################### build-timeout: 45 + packer-cloud-settings: packer-cloud-env wrappers: - lf-infra-wrappers: @@ -128,19 +129,34 @@ - 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: diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 7d3e1219..7d2cd983 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -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: | diff --git a/test.template b/test.template index 7ff5c07a..81bd9073 100644 --- a/test.template +++ b/test.template @@ -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