mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
offline_signing: add command to start rolling an update
Reduce the group update rate to 3/minute on amd64-usr only, then update the channel version.
This commit is contained in:
parent
b372c56d6d
commit
716b081cdf
@ -6,6 +6,11 @@ declare -A APPID
|
||||
APPID[amd64-usr]=e96281a6-d1af-4bde-9a0a-97b76e56dc57
|
||||
APPID[arm64-usr]=103867da-e3a2-4c92-b0b3-7fbd7f7d8b71
|
||||
|
||||
declare -A RELEASE_CHANNEL
|
||||
RELEASE_CHANNEL[alpha]=Alpha
|
||||
RELEASE_CHANNEL[beta]=Beta
|
||||
RELEASE_CHANNEL[stable]=Stable
|
||||
|
||||
download() {
|
||||
local channel="$1"
|
||||
local version="$2"
|
||||
@ -64,20 +69,50 @@ upload() {
|
||||
fi
|
||||
}
|
||||
|
||||
roll() {
|
||||
local channel="$1"
|
||||
local version="$2"
|
||||
local board="$3"
|
||||
|
||||
# Only ramp rollouts on AMD64; ARM64 is too small
|
||||
if [[ "$board" = "amd64-usr" ]]; then
|
||||
updateservicectl \
|
||||
--server="https://public.update.core-os.net" \
|
||||
--user="${ROLLER_USERNAME}" \
|
||||
--key="${ROLLER_API_KEY}" \
|
||||
group update \
|
||||
--app-id="${APPID[${board}]}" \
|
||||
--group-id="${channel}" \
|
||||
--update-count=3 \
|
||||
--update-interval=60
|
||||
fi
|
||||
|
||||
# FIXME(bgilbert): We set --publish=true because there's no way to
|
||||
# say --publish=unchanged
|
||||
updateservicectl \
|
||||
--server="https://public.update.core-os.net" \
|
||||
--user="${ROLLER_USERNAME}" \
|
||||
--key="${ROLLER_API_KEY}" \
|
||||
channel update \
|
||||
--app-id="${APPID[${board}]}" \
|
||||
--channel="${RELEASE_CHANNEL[${channel}]}" \
|
||||
--publish=true \
|
||||
--version="${version}"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 {download|upload} <ARTIFACT-DIR> [{-a|-b|-s} <VERSION>]..." >&2
|
||||
echo "Usage: $0 roll [{-a|-b|-s} <VERSION>]..." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse base arguments.
|
||||
# Parse subcommand.
|
||||
CMD="${1:-}"
|
||||
BASEDIR="${2:-}"
|
||||
shift 2 ||:
|
||||
|
||||
shift ||:
|
||||
case "${CMD}" in
|
||||
download)
|
||||
;;
|
||||
upload)
|
||||
upload|roll)
|
||||
if [[ -e "${HOME}/.config/roller.conf" ]]; then
|
||||
. "${HOME}/.config/roller.conf"
|
||||
fi
|
||||
@ -92,14 +127,21 @@ case "${CMD}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "${BASEDIR}" ]]; then
|
||||
usage
|
||||
fi
|
||||
# Parse basedir if necessary.
|
||||
case "${CMD}" in
|
||||
download|upload)
|
||||
BASEDIR="${1:-}"
|
||||
shift ||:
|
||||
if [[ -z "${BASEDIR}" ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [[ -d "${BASEDIR}" && ! -O "${BASEDIR}" ]]; then
|
||||
echo "Fixing ownership of ${BASEDIR}..."
|
||||
sudo chown -R "${USER}" "${BASEDIR}"
|
||||
fi
|
||||
if [[ -d "${BASEDIR}" && ! -O "${BASEDIR}" ]]; then
|
||||
echo "Fixing ownership of ${BASEDIR}..."
|
||||
sudo chown -R "${USER}" "${BASEDIR}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Walk argument pairs.
|
||||
while [[ $# > 0 ]]; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user