mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-29 22:42:10 +01:00
offline_signing: take download channel as an arg
A validation for the channel variable was also added so old users of the 3-argument form would get a sensical error if they used a invocation from their history.
This commit is contained in:
parent
dacdc004fd
commit
cb38d3125b
@ -1,11 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ex
|
set -eux
|
||||||
BOARD="$1"
|
|
||||||
VERSION="$2"
|
|
||||||
GS="gs://builds.release.core-os.net/stable/boards/$BOARD/$VERSION"
|
|
||||||
|
|
||||||
cd "${3:-.}"
|
BOARD="${1?Must provide a board (e.g. amd64-usr)}"
|
||||||
|
VERSION="${2?Must provide a version (e.g. 1234.0.0)}"
|
||||||
|
CHANNEL="${3?Must provide a channel (e.g. alpha)}"
|
||||||
|
|
||||||
|
if ! [[ "${CHANNEL}" =~ alpha|beta|stable ]]; then
|
||||||
|
echo "Invalid channel ${CHANNEL}"
|
||||||
|
echo "Usage: $0 <BOARD> <VERSION> <CHANNEL> [OUTPUT DIR]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GS="gs://builds.release.core-os.net/${CHANNEL}/boards/$BOARD/$VERSION"
|
||||||
|
|
||||||
|
cd "${4:-.}"
|
||||||
|
|
||||||
gsutil cp \
|
gsutil cp \
|
||||||
"${GS}/coreos_production_image.vmlinuz" \
|
"${GS}/coreos_production_image.vmlinuz" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user