packer/build-image: fail earlier without a board file.

This commit is contained in:
Kyle Isom 2023-04-13 09:49:47 -07:00
parent 41d955b195
commit d3b1b427aa
1 changed files with 5 additions and 6 deletions

View File

@ -30,17 +30,16 @@ preflight () {
fi fi
;; ;;
custom) custom)
PACKER_BUILD_FILE="${2:-}"
if [ "${SKIP_LOCAL_CACHE}" != "yes" ]
then
REMOTE_IMAGE_URL="$(jq '.builders[0].file_urls' ${PACKER_BUILD_FILE} | grep https | tr -d ' \",')"
fi
if [ -z "${PACKER_BUILD_FILE}" ] if [ -z "${PACKER_BUILD_FILE}" ]
then then
errmsg "[!] custom board requires a board file path" errmsg "[!] custom board requires a board file path"
exit 1 exit 1
fi fi
if [ "${SKIP_LOCAL_CACHE}" != "yes" ]
then
REMOTE_IMAGE_URL="$(jq '.builders[0].file_urls' ${PACKER_BUILD_FILE} | grep https | tr -d ' \",')"
fi
;; ;;
*) *)
errmsg "[!] invalid image type ${IMAGE_TYPE}." errmsg "[!] invalid image type ${IMAGE_TYPE}."