debug output
This commit is contained in:
@@ -14,15 +14,28 @@ SSH_OPTS=(
|
||||
-o StrictHostKeyChecking=no
|
||||
-o UserKnownHostsFile=/dev/null
|
||||
-o LogLevel=ERROR
|
||||
-q
|
||||
)
|
||||
if [[ "${DEBUG_DEPLOY:-0}" = "1" ]]; then
|
||||
SSH_OPTS=("${SSH_OPTS[@]/-q/}" -vv)
|
||||
SSH_OPTS+=(-vv)
|
||||
fi
|
||||
|
||||
printf '[bootstrap-shared-network] target=%s network=%s\n' "$REMOTE_TARGET" "$DOCKER_SHARED_NETWORK" >&2
|
||||
|
||||
set +e
|
||||
ssh_output="$(
|
||||
ssh "${SSH_OPTS[@]}" "$REMOTE_TARGET" \
|
||||
DOCKER_SHARED_NETWORK="$DOCKER_SHARED_NETWORK" bash -s <<'EOSSH'
|
||||
DOCKER_SHARED_NETWORK="$DOCKER_SHARED_NETWORK" bash -s 2>&1 <<'EOSSH'
|
||||
set -euo pipefail
|
||||
docker network inspect "$DOCKER_SHARED_NETWORK" >/dev/null 2>&1 || \
|
||||
docker network create "$DOCKER_SHARED_NETWORK"
|
||||
EOSSH
|
||||
)"
|
||||
ssh_status=$?
|
||||
set -e
|
||||
|
||||
if [[ $ssh_status -ne 0 ]]; then
|
||||
[[ -n "$ssh_output" ]] && printf '%s\n' "$ssh_output" >&2
|
||||
exit "$ssh_status"
|
||||
fi
|
||||
|
||||
[[ -n "$ssh_output" ]] && printf '%s\n' "$ssh_output"
|
||||
|
||||
Reference in New Issue
Block a user