As preparation to enable the ability to configure multiple builders
in a single packer template, we need to enable the ability in the
job to select which builder to run.
This patch sets up a new variable "packer-builder" which is used to
select the builder definition in the templates file.
Defaulting to "openstack" as that's the most common use case at the
moment.
Issue: RELENG-1052
Change-Id: Ib33a00f38a0005af69d52e7697322a2e84f6c674
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
submodule-recursive: true
submodule-timeout: 10
submodule-disable: false
+ packer-builder: openstack
packer-cloud-settings: packer-cloud-env
packer-version: 1.4.2
- lf-infra-packer-build:
openstack: "{openstack}"
openstack-cloud: "{openstack-cloud}"
+ packer-builder: "{packer-builder}"
packer-cloud-settings: "{packer-cloud-settings}"
packer-version: "{packer-version}"
platform: "{platforms}"
variable: CLOUDENV
- inject:
properties-content: |
+ PACKER_BUILDER={packer-builder}
PACKER_PLATFORM={platform}
PACKER_TEMPLATE={template}
PACKER_VERSION={packer-version}
--- /dev/null
+---
+features:
+ - |
+ Packer CI jobs now have the ability to specify which "builder" to use in
+ the job. Default configuration is the for the "openstack" builder.
+upgrade:
+ - |
+ Requires common-packer v0.7.0 if using packer CI jobs.
+ - |
+ If your project is in AWS and uses the Packer CI jobs to build AMIs you
+ must set ``packer-builder: aws`` when upgrading to this version of
+ global-jjb or your jobs will default to openstack and fail.
set +x
packer.io build -color=false \
+ -only "${PACKER_BUILDER}" \
-var-file="$CLOUDENV" \
-var-file="$platform_file" \
"templates/$PACKER_TEMPLATE.json"