mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
transfer.sh: add subcommands to devsign and sign releases
Both subcommands take a SIGDIR argument which is assumed to be within a git repo we can safely sync. devsign creates commits but does not (currently) push them, leaving that to the user.
This commit is contained in:
parent
e443b9afdb
commit
6d1cfa6a75
@ -46,6 +46,28 @@ download() {
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
devsign() {
|
||||||
|
local channel="$1"
|
||||||
|
local version="$2"
|
||||||
|
|
||||||
|
"$(dirname $0)/../core_dev_sign_update" \
|
||||||
|
--data_dir "${BASEDIR}" \
|
||||||
|
--version "${version}" \
|
||||||
|
--output_dir "${SIGDIR}"
|
||||||
|
|
||||||
|
git -C "${SIGDIR}" add .
|
||||||
|
git -C "${SIGDIR}" commit -m "Add sigs from ${USER} for ${channel} ${version}"
|
||||||
|
}
|
||||||
|
|
||||||
|
sign() {
|
||||||
|
local channel="$1"
|
||||||
|
local version="$2"
|
||||||
|
|
||||||
|
"$(dirname $0)/sign.sh" \
|
||||||
|
"${BASEDIR}/${BOARD}/${version}" \
|
||||||
|
"${SIGDIR}/${BOARD}/${version}"
|
||||||
|
}
|
||||||
|
|
||||||
upload() {
|
upload() {
|
||||||
local channel="$1"
|
local channel="$1"
|
||||||
local version="$2"
|
local version="$2"
|
||||||
@ -141,6 +163,7 @@ roll() {
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 {download|upload} <ARTIFACT-DIR> [{-a|-b|-s} <VERSION>]..." >&2
|
echo "Usage: $0 {download|upload} <ARTIFACT-DIR> [{-a|-b|-s} <VERSION>]..." >&2
|
||||||
|
echo "Usage: $0 {devsign|sign} <ARTIFACT-DIR> <SIG-DIR> [{-a|-b|-s} <VERSION>]..." >&2
|
||||||
echo "Usage: $0 ready [{-a|-b|-s} <VERSION>]..." >&2
|
echo "Usage: $0 ready [{-a|-b|-s} <VERSION>]..." >&2
|
||||||
echo "Usage: $0 roll [{-a|-b|-s} <HOURS-TO-100-PERCENT>]..." >&2
|
echo "Usage: $0 roll [{-a|-b|-s} <HOURS-TO-100-PERCENT>]..." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -150,7 +173,7 @@ usage() {
|
|||||||
CMD="${1:-}"
|
CMD="${1:-}"
|
||||||
shift ||:
|
shift ||:
|
||||||
case "${CMD}" in
|
case "${CMD}" in
|
||||||
download)
|
download|devsign|sign)
|
||||||
;;
|
;;
|
||||||
upload|ready|roll)
|
upload|ready|roll)
|
||||||
if [[ -e "${HOME}/.config/roller.conf" ]]; then
|
if [[ -e "${HOME}/.config/roller.conf" ]]; then
|
||||||
@ -167,9 +190,9 @@ case "${CMD}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Parse basedir if necessary.
|
# Parse fixed args if necessary.
|
||||||
case "${CMD}" in
|
case "${CMD}" in
|
||||||
download|upload)
|
download|devsign|sign|upload)
|
||||||
BASEDIR="${1:-}"
|
BASEDIR="${1:-}"
|
||||||
shift ||:
|
shift ||:
|
||||||
if [[ -z "${BASEDIR}" ]]; then
|
if [[ -z "${BASEDIR}" ]]; then
|
||||||
@ -177,6 +200,23 @@ case "${CMD}" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
case "${CMD}" in
|
||||||
|
devsign|sign)
|
||||||
|
SIGDIR="${1:-}"
|
||||||
|
shift ||:
|
||||||
|
if [[ -z "${SIGDIR}" ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Sync SIGDIR exactly once.
|
||||||
|
case "${CMD}" in
|
||||||
|
devsign|sign)
|
||||||
|
echo "Updating ${SIGDIR}..."
|
||||||
|
git -C "${SIGDIR}" pull -r
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Walk argument pairs.
|
# Walk argument pairs.
|
||||||
while [[ $# > 0 ]]; do
|
while [[ $# > 0 ]]; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user