Deploy: up died on QuTS hero's older bash
`compose "${profile[@]}" up -d "${build[@]}"` aborts with "profile[@]:
unbound variable" on bash 4.3 and older, which treats expanding an EMPTY
array under `set -u` as unbound. DSM ships a newer bash, so this only
surfaced on QNAP. The ${arr[@]+"${arr[@]}"} form expands to nothing when
empty and is identical otherwise.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SqJYt7jD7oUEkoY68sBZo
This commit is contained in:
+5
-1
@@ -363,8 +363,12 @@ cmd_up() {
|
|||||||
then re-run this command."
|
then re-run this command."
|
||||||
fi
|
fi
|
||||||
detect_compose
|
detect_compose
|
||||||
|
# ${arr[@]+"${arr[@]}"} rather than plain "${arr[@]}": under `set -u`, bash
|
||||||
|
# 4.3 and older — which is what QuTS hero ships — treats expanding an EMPTY
|
||||||
|
# array as an unbound variable and aborts. The +-form expands to nothing at
|
||||||
|
# all when the array is empty, and is identical otherwise.
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
compose "${profile[@]}" up -d "${build[@]}" $COMPOSE_WAIT
|
compose ${profile[@]+"${profile[@]}"} up -d ${build[@]+"${build[@]}"} $COMPOSE_WAIT
|
||||||
health_gate || die "services did not come up healthy — check: ./deploy/webmail.sh logs"
|
health_gate || die "services did not come up healthy — check: ./deploy/webmail.sh logs"
|
||||||
record_version "${IMAGE_TAG:-local}"
|
record_version "${IMAGE_TAG:-local}"
|
||||||
grn "up. open http://<this-host>:${WEB_PORT:-8088}/"
|
grn "up. open http://<this-host>:${WEB_PORT:-8088}/"
|
||||||
|
|||||||
Reference in New Issue
Block a user