Pass the builder type to verify jobs 76/66576/2 v0.60.2
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 22 Jan 2021 02:04:03 +0000 (12:04 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Fri, 22 Jan 2021 02:48:23 +0000 (12:48 +1000)
The default builder type must be passed to packer verify jobs. For
packer jobs build on aws, set the `packer-builder: aws` in downstream
CI-management.

Change-Id: I599d167a957189584ef5b796c049d82e5a85ec7a
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
docs/jjb/lf-macros.rst
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
releasenotes/notes/pass-packer-builder-type-to-verify-jobs-396e0f450143f6c1.yaml [new file with mode: 0644]
shell/packer-build.sh
shell/packer-validate.sh

index 1ea2cfa..955e224 100644 (file)
@@ -127,6 +127,7 @@ Run `packer build` to build system images.
     :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.
+    :packer-builder: builder type to use. ex: aws, openstack (default: openstack)
 
 :Optional parameters:
 
@@ -145,6 +146,7 @@ Run ``packer validate`` to verify packer configuration.
     :packer-cloud-settings: Cloud configuration file. Loaded on the build
         server as CLOUDENV environment variable.
     :packer-version: Version of packer to use.
+    :packer-builder: builder type to use. ex: aws, openstack (default: openstack)
 
 lf-infra-push-gerrit-patch
 --------------------------
index 39ebc8f..689892b 100644 (file)
           openstack: "{openstack}"
           openstack-cloud: "{openstack-cloud}"
           packer-cloud-settings: "{packer-cloud-settings}"
+          packer-builder: "{packer-builder}"
           packer-version: "{packer-version}"
 
 - job-template:
index f5021d2..9f74046 100644 (file)
               variable: CLOUDENV
       - inject:
           properties-content: |
+            PACKER_BUILDER={packer-builder}
             PACKER_VERSION={packer-version}
       - shell: !include-raw-escape:
           - ../shell/packer-install.sh
diff --git a/releasenotes/notes/pass-packer-builder-type-to-verify-jobs-396e0f450143f6c1.yaml b/releasenotes/notes/pass-packer-builder-type-to-verify-jobs-396e0f450143f6c1.yaml
new file mode 100644 (file)
index 0000000..530506e
--- /dev/null
@@ -0,0 +1,8 @@
+---
+fixes:
+  - |
+    Pass the builder type to verify jobs
+
+    The default builder type must be passed to packer verify jobs. For
+    packer jobs to run on aws, set the `packer-builder: aws` in downstream
+    CI-management repositories.
index 1a44e4f..4cb3df3 100644 (file)
@@ -21,6 +21,7 @@ PACKER_LOGS_DIR="$WORKSPACE/archives/packer"
 PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log"
 mkdir -p "$PACKER_LOGS_DIR"
 export PATH="${WORKSPACE}/bin:$PATH"
+export PACKER_BUILDER=${PACKER_BUILDER:-openstack}
 
 cd packer
 
index 61e1431..af766c3 100644 (file)
@@ -19,6 +19,7 @@ set -eu -o pipefail
 PACKER_LOGS_DIR="$WORKSPACE/archives/packer"
 mkdir -p "$PACKER_LOGS_DIR"
 export PATH="${WORKSPACE}/bin:$PATH"
+export PACKER_BUILDER=${PACKER_BUILDER:-openstack}
 
 cd packer
 varfiles=(vars/*.json common-packer/vars/*.json)