Pass the builder type to verify jobs
[releng/global-jjb.git] / shell / packer-validate.sh
index dff5397..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)
@@ -26,8 +27,9 @@ templates=(templates/*.json)
 
 for varfile in "${varfiles[@]}"; do
     # cloud-env.json is a file containing credentials which is pulled in via
-    # CLOUDENV variable so skip it here.
-    if [[ "$varfile" == *"cloud-env.json"* ]]; then
+    # CLOUDENV variable so skip it here. Also handle the case where a project
+    # has not vars/*.json file.
+    if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then
         continue
     fi