: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)
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
------------------------
stream: master
submodule-recursive: true
packer-cloud-settings: packer-cloud-env
- packer-version: 1.2.3
+ packer-version: 1.2.5
#####################
# Job Configuration #
- 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}'
- 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}'
--- /dev/null
+---
+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``