Files
computer-playbook/scripts/tests/deploy/ci/one.sh
kevinveenbirkenbachandClaude Opus 5.5 281a9cce9b fix(ci): name the preserved environment for sudo-rs runners
ubuntu-latest is rolling over to ubuntu-26.04, whose sudo is sudo-rs. It
ignores `-E` ("preserving the entire environment is not supported") and
hands the child only the explicit `env` assignments, so the swarm matrix
died at import with `KeyError: 'INFINITO_SRC_DIR'` before any inventory
existed (PR #1009, Nextcloud#0). Jobs that landed on ubuntu-24.04 kept
passing.

Every `sudo -E` now passes the caller's exported names through
`--preserve-env="$(compgen -e | paste -sd, -)"`, which both classic sudo
and sudo-rs honour. A lint rejects `sudo -E` and bare `--preserve-env`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 13:07:18 +02:00

35 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Deploy `apps` on the distro the loop is currently on: the per-app override
# when the app ships one, otherwise the shared dedicated.sh path.
#
# Param:
# apps app id under test
# INFINITO_DISTRO distro under test (exported by distros.sh)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
: "${apps:?apps is required (e.g. apps=web-app-keycloak)}"
: "${INFINITO_DISTRO:?INFINITO_DISTRO is required (exported by scripts/tests/deploy/distros.sh)}"
: "${INFINITO_DEPLOY_MODE:?INFINITO_DEPLOY_MODE is required (declared by the deploy workflow)}"
# shellcheck source=scripts/tests/deploy/utils/filesystem/pick.sh
. "${REPO_ROOT}/scripts/tests/deploy/utils/filesystem/pick.sh"
filesystem_pick "${INFINITO_DEPLOY_MODE}/${apps}/${INFINITO_DISTRO}" runner
if [ -n "${INFINITO_DOCKER_FILESYSTEM:-}" ]; then
sudo --preserve-env="$(compgen -e | paste -sd, -)" "${REPO_ROOT}/scripts/tests/deploy/utils/filesystem/docker_dataroot.sh" \
"${INFINITO_DOCKER_FILESYSTEM}" "${INFINITO_DOCKER_FILESYSTEM_REQUIRED}" 30G \
"${INFINITO_DEPLOY_MODE}-runner"
fi
INFINITO_IMAGE="$(bash "${REPO_ROOT}/scripts/meta/resolve/image/ci.sh")"
export INFINITO_IMAGE
if [[ -f "${SCRIPT_DIR}/custom/${apps}.sh" ]]; then
exec bash "${SCRIPT_DIR}/custom/${apps}.sh"
fi
exec "${SCRIPT_DIR}/dedicated.sh" --apps "${apps}"