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:
2026-07-10 11:41:54 +00:00
parent dcfb7805cd
commit d14b719bd2
+6 -3
View File
@@ -69,9 +69,10 @@ jobs:
PORTAINER_ENDPOINT_ID: ${{ secrets.PORTAINER_ENDPOINT_ID }} PORTAINER_ENDPOINT_ID: ${{ secrets.PORTAINER_ENDPOINT_ID }}
PORTAINER_STACK_ID: ${{ secrets.PORTAINER_STACK_ID }} PORTAINER_STACK_ID: ${{ secrets.PORTAINER_STACK_ID }}
run: | run: |
set -euo pipefail # NOTE: no `set -e` here on purpose — the auto-discovery loop below
# needs to try every candidate even if some probes fail, and some
echo "--- Step 0a: debug network from inside the job container ---" # diagnostic commands (ip route, hostname -I) might return empty
# in unusual container network setups without aborting the job.
echo "hostname: $(hostname)" echo "hostname: $(hostname)"
echo "hostname -I:" echo "hostname -I:"
hostname -I 2>/dev/null || echo "(none)" hostname -I 2>/dev/null || echo "(none)"
@@ -120,6 +121,8 @@ jobs:
if [ -z "$PORTAINER_URL" ]; then if [ -z "$PORTAINER_URL" ]; then
echo "ERROR: no candidate URL reached Portainer. Tried: ${CANDIDATES[@]}" >&2 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 exit 1
fi fi