From ff2d2161427f15cbd0e1bb0aeafcc77558b55339 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 21 May 2014 13:39:56 -0700 Subject: [PATCH] fix(release_util): Add options to configure download path. Since the new bucket scheme uploads images to a private staging area first we need to configure the final location to generate vagrant json metadata correctly. --- build_library/release_util.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build_library/release_util.sh b/build_library/release_util.sh index 1d34f5c3b5..6d88aaec48 100644 --- a/build_library/release_util.sh +++ b/build_library/release_util.sh @@ -24,6 +24,10 @@ DEFINE_string upload_root "${COREOS_UPLOAD_ROOT}" \ "Upload prefix, board/version/etc will be appended. Must be a gs:// URL." DEFINE_string upload_path "" \ "Full upload path, overrides --upload_root. Must be a full gs:// URL." +DEFINE_string download_root "" \ + "HTTP download prefix, board/version/etc will be appended." +DEFINE_string download_path "" \ + "HTTP download path, overrides --download_root." DEFINE_string sign "" \ "Sign all files to be uploaded with the given GPG key." DEFINE_string sign_digests "" \ @@ -185,9 +189,12 @@ download_image_url() { echo "$1" return 0 fi - local upload_path="${UPLOAD_ROOT}/${BOARD}/${COREOS_VERSION_STRING}" - if [[ -n "${UPLOAD_PATH}" ]]; then - upload_path="${UPLOAD_PATH}" + + local download_root="${FLAGS_download_root:-${UPLOAD_ROOT}}" + local download_path="${download_root%%/}/${BOARD}/${COREOS_VERSION_STRING}" + if [[ -n "${FLAGS_download_path}" ]]; then + download_path="${FLAGS_download_path%%/}" fi - echo "http://${upload_path#gs://}/$1" + + echo "http://${download_path#gs://}/$1" }