Add a DEPLOY_ZIP setting
This commit is contained in:
parent
d945d422d4
commit
61a994c88c
|
@ -68,6 +68,10 @@ The following environment variables are supported:
|
||||||
|
|
||||||
Output directory for target system images and NOOBS bundles.
|
Output directory for target system images and NOOBS bundles.
|
||||||
|
|
||||||
|
* `DEPLOY_ZIP` (Default: `1`)
|
||||||
|
|
||||||
|
Setting to `0` will deploy the actual image (`.img`) instead of a zipped image (`.zip`).
|
||||||
|
|
||||||
* `USE_QEMU` (Default: `"0"`)
|
* `USE_QEMU` (Default: `"0"`)
|
||||||
|
|
||||||
Setting to '1' enables the QEMU mode - creating an image that can be mounted via QEMU for an emulated
|
Setting to '1' enables the QEMU mode - creating an image that can be mounted via QEMU for an emulated
|
||||||
|
|
1
build.sh
1
build.sh
|
@ -151,6 +151,7 @@ BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
export SCRIPT_DIR="${BASE_DIR}/scripts"
|
export SCRIPT_DIR="${BASE_DIR}/scripts"
|
||||||
export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}"
|
export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}"
|
||||||
export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}
|
export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}
|
||||||
|
export DEPLOY_ZIP="${DEPLOY_ZIP:-1}"
|
||||||
export LOG_FILE="${WORK_DIR}/build.log"
|
export LOG_FILE="${WORK_DIR}/build.log"
|
||||||
|
|
||||||
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
|
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
|
||||||
|
|
|
@ -75,10 +75,15 @@ unmount_image "${IMG_FILE}"
|
||||||
mkdir -p "${DEPLOY_DIR}"
|
mkdir -p "${DEPLOY_DIR}"
|
||||||
|
|
||||||
rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip"
|
rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip"
|
||||||
|
rm -f "${DEPLOY_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
|
||||||
|
|
||||||
pushd "${STAGE_WORK_DIR}" > /dev/null
|
if [ "${DEPLOY_ZIP}" == "1" ]; then
|
||||||
zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \
|
pushd "${STAGE_WORK_DIR}" > /dev/null
|
||||||
"$(basename "${IMG_FILE}")"
|
zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \
|
||||||
popd > /dev/null
|
"$(basename "${IMG_FILE}")"
|
||||||
|
popd > /dev/null
|
||||||
|
else
|
||||||
|
cp "$IMG_FILE" "$DEPLOY_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
cp "$INFO_FILE" "$DEPLOY_DIR"
|
cp "$INFO_FILE" "$DEPLOY_DIR"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user