From 8183430f6cf7d7369b139a6c90f569746a0d3f12 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 28 Apr 2014 23:24:30 -0400 Subject: [PATCH] feat(vm_image_util): Add Vagrant metadata file This is required for Vagrant to recognize box versions: http://docs.vagrantup.com/v2/boxes/versioning.html --- build_library/release_util.sh | 14 ++++++++++++++ build_library/vm_image_util.sh | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/build_library/release_util.sh b/build_library/release_util.sh index f5dba907cb..0210d1e958 100644 --- a/build_library/release_util.sh +++ b/build_library/release_util.sh @@ -174,3 +174,17 @@ upload_image() { local def_upload_path="${UPLOAD_ROOT}/${BOARD}/${COREOS_VERSION_STRING}" upload_files "${log_msg}" "${def_upload_path}" "" "${uploads[@]}" } + +# Translate the configured upload URL to a download URL +# Usage: download_image_url "path/suffix" +download_image_url() { + if [[ ${FLAGS_upload} -ne ${FLAGS_TRUE} ]]; then + echo "$1" + return 0 + fi + local upload_path="${UPLOAD_ROOT}/${BOARD}/${COREOS_VERSION_STRING}" + if [[ -n "${UPLOAD_PATH}" ]]; then + upload_path="${UPLOAD_PATH}" + fi + echo "http://${upload_path#gs://}/$1" +} diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 5fefafaf61..43731cd0f0 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -717,10 +717,27 @@ write_vm_bundle() { _write_box_bundle() { local box=$(_dst_path ".box") + local json=$(_dst_path ".json") mv "${VM_DST_IMG}" "${VM_TMP_DIR}/box" tar -czf "${box}" -C "${VM_TMP_DIR}/box" . - VM_GENERATED_FILES+=( "${box}" ) + + cat >"${json}" <