From 50bc0ffefdd92f9dad902a20640e924a2899aa46 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 28 Mar 2014 17:46:27 -0700 Subject: [PATCH 1/2] fix(core_roller_upload): Assorted minor script fixes. --- core_roller_upload | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/core_roller_upload b/core_roller_upload index a5237f5fed..47b51abc22 100755 --- a/core_roller_upload +++ b/core_roller_upload @@ -18,14 +18,19 @@ DEFINE_string image "coreos_production_image.bin" \ "Path to the production image (not base/dev/qemu/xen/etc)" DEFINE_string version "${COREOS_VERSION_STRING}" \ "Version number of this build." +DEFINE_string app_id "e96281a6-d1af-4bde-9a0a-97b76e56dc57" \ + "CoreOS AppId in roller." DEFINE_string user "" \ "User for roller." DEFINE_string api_key "" \ "API key for roller." -DEFINE_string endpoint "https://public.roller.core-os.net" \ +DEFINE_string endpoint "http://public.roller.core-os.net" \ "Roller endpoint to update." +DEFINE_boolean update_storage ${FLAGS_FALSE} \ + "Update image download location for group on storage.core-os.net." + FLAGS_HELPS="usage: $SCRIPTNAME [flags] @@ -46,20 +51,24 @@ switch_to_strict_mode [[ -z "${FLAGS_user}" ]] && die "--user is required" MD5SUM=$(md5sum ${FLAGS_image} | cut -f1 -d" ") +[[ -z "$MD5SUM" ]] && die "Failed to hash ${FLAGS_image}" URL="update-storage.core-os.net/${FLAGS_board}/${FLAGS_group}/$MD5SUM/update.gz" gsutil cp "update.gz" gs://${URL} rollerctl \ - -s ${FLAGS_endpoint} + -s ${FLAGS_endpoint} \ -u ${FLAGS_user} \ -k ${FLAGS_api_key} \ new-package \ --url "http://${URL}" \ --file "update.gz" \ --meta "update.meta" \ - --version "${FLAGS_version}" + --version "${FLAGS_version}" \ + "${FLAGS_app_id}" # Copy the vagrant boxes and pre-built images over to the group mirror -gsutil cp \ - "${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_version}/*" \ - "${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_group}/" +if [[ "${FLAGS_update_storage}" -eq "${FLAGS_TRUE}" ]]; then + gsutil cp \ + "${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_version}/*" \ + "${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_group}/" +fi From 9b8f739fd018ed295f67c5738e18e6a91cc3d518 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 31 Mar 2014 11:18:53 -0700 Subject: [PATCH 2/2] fix(core_roller_upload): Update to new roller HTTPS URL. --- core_roller_upload | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_roller_upload b/core_roller_upload index 47b51abc22..63a6604d2a 100755 --- a/core_roller_upload +++ b/core_roller_upload @@ -25,7 +25,7 @@ DEFINE_string user "" \ "User for roller." DEFINE_string api_key "" \ "API key for roller." -DEFINE_string endpoint "http://public.roller.core-os.net" \ +DEFINE_string endpoint "https://public.update.core-os.net" \ "Roller endpoint to update." DEFINE_boolean update_storage ${FLAGS_FALSE} \