Promote v0.1.14 to production
This commit is contained in:
+33
-3
@@ -179,6 +179,16 @@ Options:
|
||||
EOF
|
||||
}
|
||||
|
||||
# The command line as given, shell-quoted: a refusal can then print the exact
|
||||
# command to run next instead of a flag to add by hand.
|
||||
ORIG_ARGS=""
|
||||
for _arg in "$@"; do
|
||||
case "$_arg" in
|
||||
*[!A-Za-z0-9_./:=@,+-]*|"") ORIG_ARGS="$ORIG_ARGS '$(printf '%s' "$_arg" | sed "s/'/'\\\\''/g")'" ;;
|
||||
*) ORIG_ARGS="$ORIG_ARGS $_arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--version) VERSION="$2"; shift 2 ;;
|
||||
@@ -388,6 +398,29 @@ esac
|
||||
# by digest, and lets the daemon pull, health-gate and roll back. A freshly
|
||||
# downloaded install.sh is trust-on-first-use again; handing the update to the
|
||||
# installed gpuk keeps a re-run inside the chain the first install established.
|
||||
# An install older than gpuk-on-the-host has nothing to hand the update to: the
|
||||
# only way forward is a reinstall over it. Offer it on a terminal, and always
|
||||
# print the complete command — never a flag to splice in by hand.
|
||||
if [ "$EXISTING" = "manifest" ] && [ -z "$RECONFIGURE" ] && [ "$DRY_RUN" -eq 0 ] \
|
||||
&& [ ! -x "$GPUK_CLI" ]; then
|
||||
step "Update — this install predates gpuk on the host"
|
||||
REINSTALL_CMD="curl -fsSL https://gpu.kitchen/install.sh | sudo sh -s --$ORIG_ARGS --reinstall"
|
||||
echo " It has no $GPUK_CLI to update it with. Reinstalling over it keeps its settings"
|
||||
echo " and leaves gpuk on the host for every later update:"
|
||||
echo
|
||||
echo " $REINSTALL_CMD"
|
||||
echo
|
||||
if can_prompt; then
|
||||
ask " Reinstall over it now? [Y/n] "
|
||||
case "$REPLY" in
|
||||
""|y|Y|yes|YES|o|O|oui) REINSTALL=1; reconfigure "--reinstall" ;;
|
||||
*) die "nothing was changed. Run the command above when you are ready." ;;
|
||||
esac
|
||||
else
|
||||
die "nothing was changed. Run the command above to reinstall over it."
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$EXISTING" = "manifest" ] && [ -z "$RECONFIGURE" ]; then
|
||||
step "Update — handed to the installed gpuk"
|
||||
if [ "$DRY_RUN" -eq 1 ]; then
|
||||
@@ -396,9 +429,6 @@ if [ "$EXISTING" = "manifest" ] && [ -z "$RECONFIGURE" ]; then
|
||||
echo " existing : yes — updated in place"
|
||||
exit 0
|
||||
fi
|
||||
[ -x "$GPUK_CLI" ] \
|
||||
|| die "this install has no $GPUK_CLI to update it with. Re-run with --reinstall: it reinstalls
|
||||
over the existing install, keeps its settings, and leaves gpuk on the host for the next update."
|
||||
"$GPUK_CLI" update || die "the update failed — gpuk reported the cause just above"
|
||||
echo
|
||||
echo "${BOLD}${GREEN}GPU Kitchen is up to date.${RESET}"
|
||||
|
||||
Reference in New Issue
Block a user