mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
17 lines
761 B
Bash
Executable File
17 lines
761 B
Bash
Executable File
#!/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
|