Files
computer-playbook/scripts/github/guide/one.sh
T
kevinveenbirkenbachandClaude Opus 5 dce60df815 feat(ci): replay the guide on every distro
guide_select picked the role, the mode and the distro in one draw, so a run proved the README instructions worked on exactly one randomly chosen distribution. The distro list was also a literal in the workflow, which meant the manual-CI distros input never reached the guide at all.

The distro draw is removed. guide_select still picks the role and derives the mode, while the shared loop from 1bbe7a0eb drives the distro dimension, and ci-orchestrator forwards its distros input.

The four mode-specific steps collapse into guide/one.sh, which the loop runs once per distro: it renders the pkgmgr base image for the current distro, then either execs host_deploy.sh or brings the compose server up and replays the README block against it.

one.sh releases the compose server in an EXIT trap. Without it the second distro would start against the stack the first one left behind. Rescue diagnostics gain a distro segment for the same reason the swarm collectors did.

The job timeout goes from 90 to 345 minutes because up to five rounds now have to fit; the loop's own budget still decides how many actually run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:06:47 +02:00

59 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Replay one role's README "Production" block on the distro the loop is
# currently on, in the mode the role dictates, then release the compose server.
#
# Param:
# GUIDE_ROLE role under test
# GUIDE_MODE host | compose
# INFINITO_DISTRO distro under test (exported by distros.sh)
# INFINITO_IMAGE_TAG tag the CI environment images were pushed under
# INFINITO_PARENT_IMAGE_OWNER owner of the pkgmgr base images
# INFINITO_PARENT_IMAGE_TAG tag of the pkgmgr base images
# INFINITO_RESCUE_DIAGNOSTICS_BASE host dir the rescue snapshots land under
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
cd "${REPO_ROOT}"
: "${GUIDE_ROLE:?GUIDE_ROLE is required (cli.meta.ci.guide_select)}"
: "${GUIDE_MODE:?GUIDE_MODE is required (cli.meta.ci.guide_select)}"
: "${INFINITO_DISTRO:?INFINITO_DISTRO is required (exported by scripts/tests/deploy/distros.sh)}"
: "${INFINITO_PARENT_IMAGE_OWNER:?INFINITO_PARENT_IMAGE_OWNER is required (default.env)}"
: "${INFINITO_PARENT_IMAGE_TAG:?INFINITO_PARENT_IMAGE_TAG is required (default.env)}"
: "${INFINITO_RESCUE_DIAGNOSTICS_BASE:?INFINITO_RESCUE_DIAGNOSTICS_BASE is required (default.env)}"
GUIDE_RUNTIME_IMAGE="$(python3 -m cli.meta.ci.image_ref --kind pkgmgr \
--distro "${INFINITO_DISTRO}" \
--owner "${INFINITO_PARENT_IMAGE_OWNER}" \
--tag "${INFINITO_PARENT_IMAGE_TAG}")"
export GUIDE_RUNTIME_IMAGE
echo "=== Guide: role=${GUIDE_ROLE} mode=${GUIDE_MODE} distro=${INFINITO_DISTRO} ==="
if [ "${GUIDE_MODE}" = "host" ]; then
exec bash "${SCRIPT_DIR}/host_deploy.sh"
fi
INFINITO_IMAGE="$(bash "${REPO_ROOT}/scripts/meta/resolve/image/ci.sh")"
export INFINITO_IMAGE
release() {
rc=$?
if [ "${rc}" -ne 0 ]; then
INFINITO_RESCUE_DIAGNOSTICS_DIR="${INFINITO_RESCUE_DIAGNOSTICS_BASE}/${INFINITO_DISTRO}/${GUIDE_ROLE}" \
timeout 1500 python3 utils/diagnostics/container.py \
"${GUIDE_ROLE}" "guide compose post-deploy failure" || true
fi
make compose-down || true
return "${rc}"
}
trap release EXIT
make compose-up
bash "${SCRIPT_DIR}/compose_deploy.sh"