From: Anil Belur Date: Thu, 13 Sep 2018 15:56:24 +0000 (+0000) Subject: Merge "Use clouds.yaml for openstack packer builders" X-Git-Tag: v0.25.0~13 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=b65f75f9185892ce5980ac40a8e4f0e4a332412c;hp=57078dc1163aca18e326239bdd4a10a8103b4283;p=releng%2Fglobal-jjb.git Merge "Use clouds.yaml for openstack packer builders" --- diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index 0ac86d99..6a8caff6 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -552,6 +552,9 @@ Packer Merge job runs `packer build` to build system images in the cloud. :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 90) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :openstack: Packer template uses an OpenStack builder (default: true). + :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter. + (default: vex). :packer-cloud-settings: Name of settings file containing credentials for the cloud that packer will build on. (default: packer-cloud-env) :packer-version: Version of packer to install / use in build. (default: 1.0.2) diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index c6334fda..1fac0433 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -110,6 +110,14 @@ lf-infra-packer-build Run `packer build` to build system images. +:Required parameters: + + :openstack: Packer template uses an OpenStack builder (true|false). + :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter. + :packer-version: Version of packer to use. + :platform: Build platform as found in the vars directory. + :template: Packer template to build as found in the templates directory. + lf-infra-packer-validate ------------------------ diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index ec3e48ee..e9e483ea 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -37,7 +37,7 @@ stream: master submodule-recursive: true packer-cloud-settings: packer-cloud-env - packer-version: 1.2.3 + packer-version: 1.2.5 ##################### # Job Configuration # @@ -1172,12 +1172,30 @@ - lf_packer_merge: &lf_packer_merge name: lf-packer-merge + ###################### + # Default parameters # + ###################### + + openstack: true + openstack-cloud: vex + ##################### # Job Configuration # ##################### + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + lftools-version: '{lftools-version}' + - lf-packer-parameters: + packer-version: '{packer-version}' + builders: - lf-infra-packer-build: + openstack: '{openstack}' + openstack-cloud: '{openstack-cloud}' packer-cloud-settings: '{packer-cloud-settings}' packer-version: '{packer-version}' platform: '{platforms}' diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 2e3a8571..59b249f2 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -81,6 +81,16 @@ - builder: name: lf-infra-packer-build builders: + - conditional-step: + condition-kind: boolean-expression + condition-expression: '{openstack}' + steps: + - config-file-provider: + files: + - file-id: clouds-yaml + target: '$HOME/.config/openstack/clouds.yaml' + - inject: + properties-content: OS_CLOUD={openstack-cloud} - config-file-provider: files: - file-id: '{packer-cloud-settings}' diff --git a/releasenotes/notes/packer-openstack-clouds-yaml-b0f8a251d9b68bee.yaml b/releasenotes/notes/packer-openstack-clouds-yaml-b0f8a251d9b68bee.yaml new file mode 100644 index 00000000..9a429d39 --- /dev/null +++ b/releasenotes/notes/packer-openstack-clouds-yaml-b0f8a251d9b68bee.yaml @@ -0,0 +1,14 @@ +--- +features: + - | + Add support to the packer-build job to use clouds.yaml for openstack builder + configuration rather than through the cloud-env file. This allows us to + simplify the template configuration for openstack builders moving forward. +upgrade: + - | + Minimum packer version 1.2.5 is now required for the packer-build job. + - | + **lf-infra-packer-build** macro now requires 2 new variables to be passed. + + #. **openstack:** Set to true if template is built using the openstack builder + #. **openstack-cloud:** The clouds.yaml cloud to use when running ``packer build``