Merge pull request #683 from nathanleclaire/make_vhd_build_more_bearable

Add support for building smaller Azure VHD for development
This commit is contained in:
Justin Cormack 2016-11-08 16:26:10 +00:00 committed by GitHub
commit 2be2b4b08f
2 changed files with 5 additions and 2 deletions

View File

@ -96,6 +96,7 @@ ami-clean-mount:
uploadvhd: azure
docker run \
-i \
-e VHD_SIZE \
-e AZURE_STG_ACCOUNT_KEY \
-e AZURE_STG_ACCOUNT_NAME \
-e CONTAINER_NAME \

View File

@ -35,8 +35,10 @@ case "$1" in
rm "${RAW_IMAGE}"
fi
VHD_SIZE=${VHD_SIZE:-"30G"}
arrowecho "Writing empty image file"
dd if=/dev/zero of="${RAW_IMAGE}" count=0 bs=1 seek=30G
dd if=/dev/zero of="${RAW_IMAGE}" count=0 bs=1 seek="${VHD_SIZE}"
arrowecho "Formatting image file for boot"
format_on_device "${RAW_IMAGE}"
@ -70,7 +72,7 @@ case "$1" in
AZURE_STG_ACCOUNT_NAME=${AZURE_STG_ACCOUNT_NAME:-"mobyvhd"}
CONTAINER_NAME=${CONTAINER_NAME:-"vhd"}
BLOBNAME=${BLOBNAME:-$(md5sum "/tmp/mobylinux.vhd" | awk '{ print $1; }')-mobylinux.vhd}
BLOBNAME=${BLOBNAME:-$(head -c 200m "/tmp/mobylinux.vhd" | md5sum | awk '{ print $1; }')-mobylinux.vhd}
BLOB_URL="https://${AZURE_STG_ACCOUNT_NAME}.blob.core.windows.net/${CONTAINER_NAME}/${BLOBNAME}"
arrowecho "Uploading VHD to ${BLOBURL}..."