mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 06:17:25 +00:00
The serial distro loop (shuffle, time budget, fast-fail skip, exit on the first failing distro) lived inline in scripts/tests/deploy/ci/all.sh and was therefore reachable only from the compose and host deploys. Swarm and guide have to iterate distros with the same semantics, so the loop moves into scripts/tests/deploy/distros.sh and takes the per-distro command as "$@". ci/all.sh keeps the app-level preamble and execs the loop with the new ci/one.sh, which resolves the CI image and dispatches to the per-app override or dedicated.sh. Image resolution leaves the loop as well: scripts/meta/resolve/image/ci.sh renders the reference through cli.meta.ci.image_ref instead of respelling ghcr.io/... locally, which meta/distros.yml declares as the single source. The two CI time knobs are declared in default.env instead of being repeated as literals, so no caller has to invent a budget. Three paths are dropped as dead: the empty budget that disabled the limit, the failed counter that could only ever print 0, and the branch for an unset deadline. Both new scripts are pinned by contract tests. Those tests clear BASH_ENV because the test container exports it as the env loader, which would otherwise re-inject every stripped key and make the assertions pass for the wrong reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
43 lines
1.2 KiB
Bash
Executable File
43 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# SPOT: Deploy exactly ONE app across all distros (serial), via the shared
|
|
# per-distro loop in scripts/tests/deploy/distros.sh.
|
|
#
|
|
# Required env:
|
|
# apps="web-app-keycloak"
|
|
# INFINITO_DISTROS="arch debian ubuntu fedora centos"
|
|
# INFINITO_INVENTORY_DIR="/path/to/inventory"
|
|
#
|
|
# Optional env:
|
|
# PYTHON="python3"
|
|
#
|
|
# Script-local defaults preserved from the old Make wrapper:
|
|
# MISSING_ONLY=true
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
|
|
cd "${REPO_ROOT}"
|
|
|
|
if [[ -f "scripts/meta/env/load.sh" ]]; then
|
|
# shellcheck source=scripts/meta/env/load.sh
|
|
source "scripts/meta/env/load.sh"
|
|
else
|
|
echo "[ERROR] Missing env file: scripts/meta/env/load.sh" >&2
|
|
exit 2
|
|
fi
|
|
|
|
: "${apps:?apps is required (e.g. apps=web-app-keycloak)}"
|
|
: "${INFINITO_DISTROS:?INFINITO_DISTROS is required (e.g. 'arch debian ubuntu fedora centos')}"
|
|
: "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR is required}"
|
|
|
|
: "${PYTHON:=python3}"
|
|
: "${MISSING_ONLY:=true}"
|
|
|
|
export INFINITO_INVENTORY_DIR MISSING_ONLY
|
|
|
|
echo ">>> Installing CI dependencies"
|
|
"${PYTHON}" -m pip install ruamel.yaml PyYAML
|
|
|
|
exec "${REPO_ROOT}/scripts/tests/deploy/distros.sh" "${SCRIPT_DIR}/one.sh"
|