mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
host_deploy.sh drops its bespoke dump: the EXIT trap now runs utils/diagnostics/container.py on failure before removing the boot container, because the workflow's failure() collect step only fires after this script has already torn the container down. That yields the full snapshot (logs, inspect, in-container systemctl and journal, DiD recursion) instead of three ad-hoc files, and successful runs skip the capture entirely. The compose-mode README replay moves out of test-guide.yml into scripts/github/guide/compose_deploy.sh unchanged; the workflow step becomes a one-liner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
849 B
Bash
Executable File
19 lines
849 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Extract the role README's "### Production" bash block and replay it against
|
|
# the running compose server, exactly as the guide instructs a human to.
|
|
# Env: GUIDE_ROLE; INFINITO_CONTAINER comes from scripts/meta/env/load.sh.
|
|
set -euo pipefail
|
|
|
|
: "${GUIDE_ROLE:?}"
|
|
|
|
awk '/^### Production$/{p=1} p && /^```bash$/{c=1; next} c && /^```$/{exit} c' \
|
|
"roles/${GUIDE_ROLE}/README.md" >/tmp/deploy.sh
|
|
sed -n '1,/docker run/p' /tmp/deploy.sh | grep -E '^[A-Z_]+=' |
|
|
sed 's#^HOST=.*#HOST=localhost#' >/tmp/run.sh
|
|
perl -0777 -ne "print \$1 if /bash -c '(.*)'/s" /tmp/deploy.sh >>/tmp/run.sh
|
|
test -s /tmp/run.sh
|
|
sed -i "s#<your-ssh-public-key>#ssh-ed25519 AAAA_TEST_DUMMY_KEY github-ci-dummy@infinito#" /tmp/run.sh
|
|
# shellcheck source=/dev/null
|
|
source scripts/meta/env/load.sh
|
|
docker exec -i "${INFINITO_CONTAINER}" bash -s </tmp/run.sh
|