Files
computer-playbook/scripts/tests/deploy/act/exec_node.sh
T
kevinveenbirkenbachandClaude Opus 4.7 d22f05353e feat(make/act-swarm): zombie target + topology SPOT
Adds `act-swarm-zombie app=<id>` which runs the swarm matrix-app test and leaves
the DinD cluster + lab network alive afterwards (INFINITO_KEEP_SWARM_NODES=true
forwarded via the new ACT_ENV passthrough in workflow.sh) so failures can be
post-mortem inspected with `make act-swarm-exec node=… cmd=…`,
`make act-swarm-shell node=…`, and finally released with `make act-swarm-down`.

Consolidates the swarm-test topology (manager / worker / nfs-server names, lab
network, NFS export base) into scripts/tests/deploy/swarm/topology.sh as the
single source of truth: 13_cleanup.sh and shell_node.sh source it directly,
the GitHub Actions workflow ingests it into $GITHUB_ENV via a setup step,
replacing the duplicate env: block entries.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 19:08:46 +02:00

18 lines
701 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
: "${node:?node= must be set, e.g. node=swarm-mgr-01}"
: "${cmd:?cmd= must be set, e.g. cmd='docker service ls'}"
if ! docker inspect --format '{{.State.Running}}' "${node}" 2>/dev/null | grep -q '^true$'; then
echo "ERROR: container '${node}' is not running." >&2
echo "Available swarm-test containers (if any):" >&2
docker ps --format ' {{.Names}}\t{{.Status}}' |
grep -E 'swarm-|nfs-server' >&2 ||
echo " (none — run \`make act-swarm-zombie app=<id>\` first)" >&2
exit 1
fi
# --noprofile --norc mirrors `make compose-exec` so a quoted pipeline survives one make-level cmd= expansion.
docker exec -i "${node}" bash --noprofile --norc -c "${cmd}"