fix(ci): guard against empty HOST_IP in smoke test
If `ip route show default` returns no output the old code passed
an empty string to curl --resolve, producing a confusing error 6
("couldn't resolve host") with no indication that gateway detection
had failed. The new guard exits immediately with a clear message.
Addresses review concern raised by Tobias Wendt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,7 @@ jobs:
|
|||||||
HOST="staging.raddatz.cloud"
|
HOST="staging.raddatz.cloud"
|
||||||
URL="https://$HOST"
|
URL="https://$HOST"
|
||||||
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
|
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
|
||||||
|
[ -n "$HOST_IP" ] || { echo "ERROR: could not detect Docker bridge gateway via 'ip route'"; exit 1; }
|
||||||
RESOLVE="--resolve $HOST:443:$HOST_IP"
|
RESOLVE="--resolve $HOST:443:$HOST_IP"
|
||||||
echo "Smoke test: $URL (pinned to $HOST_IP via bridge gateway)"
|
echo "Smoke test: $URL (pinned to $HOST_IP via bridge gateway)"
|
||||||
curl -fsS $RESOLVE --max-time 10 "$URL/login" -o /dev/null
|
curl -fsS $RESOLVE --max-time 10 "$URL/login" -o /dev/null
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ jobs:
|
|||||||
HOST="archiv.raddatz.cloud"
|
HOST="archiv.raddatz.cloud"
|
||||||
URL="https://$HOST"
|
URL="https://$HOST"
|
||||||
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
|
HOST_IP=$(ip route show default | awk '/default/ {print $3}')
|
||||||
|
[ -n "$HOST_IP" ] || { echo "ERROR: could not detect Docker bridge gateway via 'ip route'"; exit 1; }
|
||||||
RESOLVE="--resolve $HOST:443:$HOST_IP"
|
RESOLVE="--resolve $HOST:443:$HOST_IP"
|
||||||
echo "Smoke test: $URL (pinned to $HOST_IP via bridge gateway)"
|
echo "Smoke test: $URL (pinned to $HOST_IP via bridge gateway)"
|
||||||
curl -fsS $RESOLVE --max-time 10 "$URL/login" -o /dev/null
|
curl -fsS $RESOLVE --max-time 10 "$URL/login" -o /dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user