From: Jeremy Phelps Date: Thu, 18 Oct 2018 19:15:30 +0000 (-0500) Subject: Add conditional build step to use clouds.yaml X-Git-Tag: v0.26.0~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=2bbf29ef6e1a538ce2adf2511b18ab50e431958b;p=releng%2Fglobal-jjb.git Add conditional build step to use clouds.yaml This was missed in patch Idf23a30b111dd922120fb6195d0411e2fc993dab when we were implementing this feature. Issue: RELENG-1205 Change-Id: Id2017172293463c616158b79f3af826ea754fa08 Signed-off-by: Jeremy Phelps --- diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index b2905f35..53087216 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -594,6 +594,9 @@ Packer Verify job runs `packer validate` to verify packer configuration. :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 10) :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 9f35594f..bc88d8a6 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -125,6 +125,8 @@ Run `packer validate` to verify packer configuration. :Required parameters: + :openstack: Packer template uses an OpenStack builder (true|false). + :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter. :packer-cloud-settings: Cloud configuration file. Loaded on the build server as CLOUDENV environment variable. :packer-version: Version of packer to use. diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 9cfa4b82..f074bacc 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -1318,6 +1318,8 @@ ###################### build-timeout: 10 + openstack: true + openstack-cloud: vex gerrit_verify_triggers: - patchset-created-event: @@ -1344,6 +1346,8 @@ builders: - lf-infra-packer-validate: + openstack: '{openstack}' + openstack-cloud: '{openstack-cloud}' packer-cloud-settings: '{packer-cloud-settings}' packer-version: '{packer-version}' diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index ac577c8c..d81497c3 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -109,10 +109,20 @@ - builder: name: lf-infra-packer-validate 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}' - variable: 'CLOUDENV' + variable: CLOUDENV - inject: properties-content: | PACKER_VERSION={packer-version} diff --git a/releasenotes/notes/fix-packer-validate-clouds-yaml-3e3268b7c427f456.yaml b/releasenotes/notes/fix-packer-validate-clouds-yaml-3e3268b7c427f456.yaml new file mode 100644 index 00000000..5e36a5a6 --- /dev/null +++ b/releasenotes/notes/fix-packer-validate-clouds-yaml-3e3268b7c427f456.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix packer-verify job to correctly work with ``clouds.yaml`` config model + implemented in global-jjb v0.25.0.