Pass the builder type to verify jobs
[releng/global-jjb.git] / shell / packer-build.sh
index 3349a72..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
 
@@ -68,7 +69,7 @@ packer.io build -color=false \
     "templates/$PACKER_TEMPLATE.json"
 
 # Extract image name from log and store value in the downstream job
-if [[ ${UPDATE_CLOUD_IMAGE} ]]; then
+if [[ ${UPDATE_CLOUD_IMAGE} == 'true' ]]; then
 
     NEW_IMAGE_NAME=$(grep -P '(\s+.*image: )(ZZCI\s+.*\d+-\d+\.\d+)' \
                           "$PACKER_BUILD_LOG" | awk -F': ' '{print $4}')