debug(ci): print hostname/route on auto-discover failure
- Drop 'set -euo pipefail' from the redeploy step so the auto-discovery loop and the diagnostic echos can run to completion even if a probe fails or a command returns empty output. - On failure to find Portainer, also print the container's hostname, hostname -I, and ip route to stderr. This is what we'll need if the host-net job container approach doesn't work and we need to debug further.
This commit is contained in:
@@ -69,9 +69,10 @@ jobs:
|
||||
PORTAINER_ENDPOINT_ID: ${{ secrets.PORTAINER_ENDPOINT_ID }}
|
||||
PORTAINER_STACK_ID: ${{ secrets.PORTAINER_STACK_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
echo "--- Step 0a: debug network from inside the job container ---"
|
||||
# NOTE: no `set -e` here on purpose — the auto-discovery loop below
|
||||
# needs to try every candidate even if some probes fail, and some
|
||||
# diagnostic commands (ip route, hostname -I) might return empty
|
||||
# in unusual container network setups without aborting the job.
|
||||
echo "hostname: $(hostname)"
|
||||
echo "hostname -I:"
|
||||
hostname -I 2>/dev/null || echo "(none)"
|
||||
@@ -120,6 +121,8 @@ jobs:
|
||||
|
||||
if [ -z "$PORTAINER_URL" ]; then
|
||||
echo "ERROR: no candidate URL reached Portainer. Tried: ${CANDIDATES[@]}" >&2
|
||||
echo "ERROR: container hostname=$(hostname) IP=$(hostname -I)" >&2
|
||||
echo "ERROR: ip route=$(ip route 2>&1 | tr '\n' ';')" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user