mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 08:31:04 +02:00
Merge pull request #210 from marineam/roller
fix(core_roller_upload): Assorted minor script fixes.
This commit is contained in:
commit
26af3bda4b
@ -18,14 +18,19 @@ DEFINE_string image "coreos_production_image.bin" \
|
|||||||
"Path to the production image (not base/dev/qemu/xen/etc)"
|
"Path to the production image (not base/dev/qemu/xen/etc)"
|
||||||
DEFINE_string version "${COREOS_VERSION_STRING}" \
|
DEFINE_string version "${COREOS_VERSION_STRING}" \
|
||||||
"Version number of this build."
|
"Version number of this build."
|
||||||
|
DEFINE_string app_id "e96281a6-d1af-4bde-9a0a-97b76e56dc57" \
|
||||||
|
"CoreOS AppId in roller."
|
||||||
|
|
||||||
DEFINE_string user "" \
|
DEFINE_string user "" \
|
||||||
"User for roller."
|
"User for roller."
|
||||||
DEFINE_string api_key "" \
|
DEFINE_string api_key "" \
|
||||||
"API key for roller."
|
"API key for roller."
|
||||||
DEFINE_string endpoint "https://public.roller.core-os.net" \
|
DEFINE_string endpoint "https://public.update.core-os.net" \
|
||||||
"Roller endpoint to update."
|
"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]
|
FLAGS_HELPS="usage: $SCRIPTNAME [flags]
|
||||||
|
|
||||||
@ -46,20 +51,24 @@ switch_to_strict_mode
|
|||||||
[[ -z "${FLAGS_user}" ]] && die "--user is required"
|
[[ -z "${FLAGS_user}" ]] && die "--user is required"
|
||||||
|
|
||||||
MD5SUM=$(md5sum ${FLAGS_image} | cut -f1 -d" ")
|
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"
|
URL="update-storage.core-os.net/${FLAGS_board}/${FLAGS_group}/$MD5SUM/update.gz"
|
||||||
gsutil cp "update.gz" gs://${URL}
|
gsutil cp "update.gz" gs://${URL}
|
||||||
|
|
||||||
rollerctl \
|
rollerctl \
|
||||||
-s ${FLAGS_endpoint}
|
-s ${FLAGS_endpoint} \
|
||||||
-u ${FLAGS_user} \
|
-u ${FLAGS_user} \
|
||||||
-k ${FLAGS_api_key} \
|
-k ${FLAGS_api_key} \
|
||||||
new-package \
|
new-package \
|
||||||
--url "http://${URL}" \
|
--url "http://${URL}" \
|
||||||
--file "update.gz" \
|
--file "update.gz" \
|
||||||
--meta "update.meta" \
|
--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
|
# Copy the vagrant boxes and pre-built images over to the group mirror
|
||||||
gsutil cp \
|
if [[ "${FLAGS_update_storage}" -eq "${FLAGS_TRUE}" ]]; then
|
||||||
"${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_version}/*" \
|
gsutil cp \
|
||||||
"${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_group}/"
|
"${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_version}/*" \
|
||||||
|
"${COREOS_UPLOAD_ROOT}/${FLAGS_board}/${FLAGS_group}/"
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user