refactor(guide): extract the compose README deploy into a script

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Fable 5 committed 2026-07-22 16:36:12 +02:00
1 parent 62a46e472f
commit ea54eb609c
2 files changed
+17 -11

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Deploy a compose role against the booted server by replaying the
# Production block of its README inside the CI container.
# Env: GUIDE_ROLE.
set -euo pipefail
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=scripts/meta/env/load.sh
source scripts/meta/env/load.sh
docker exec -i "${INFINITO_CONTAINER}" bash -s </tmp/run.sh