Fix local platform file path
[releng/global-jjb.git] / shell / packer-build.sh
index d3e306f..34c4014 100644 (file)
@@ -22,13 +22,14 @@ PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log"
 mkdir -p "$PACKER_LOGS_DIR"
 export PATH="${WORKSPACE}/bin:$PATH"
 
+cd packer || exit
+
 # Prioritize the project's own version of vars if available
 platform_file="common-packer/vars/$PACKER_PLATFORM.json"
-if [ -f "$PACKER_PLATFORM" ]; then
+if [ -f "vars/$PACKER_PLATFORM.json" ]; then
     platform_file="vars/$PACKER_PLATFORM.json"
 fi
 
-cd packer
 export PACKER_LOG="yes"
 export PACKER_LOG_PATH="$PACKER_BUILD_LOG"
 packer.io build -color=false \