Files
computer-playbook/scripts/tests/deploy/local/deploy/main.sh
T
kevinveenbirkenbachandClaude Opus 5 f2fedfc677 Merge branch 'main' into feature/store-i18n
Fourteen real conflicts plus the 66 generated READMEs.

utils/cache/files.py and its test: both sides added a skip-dir rule, resolved
as a union so the root `build/` prune and the per-root walk key coexist.

plugins/lookup/database.py and postgres_libraries.py: main's added lookups kept,
with get_entity_name renamed to entity_name as this branch renamed it.

roles/web-app-{mailu,matrix}/meta/services.yml: main's `covers: [email]` and its
MAIL_PROVIDER-gated email entry, plus this branch's gitlab/jira/n8n/jitsi
consumers, which the merge base carried on neither side.

group_vars/all/17_resource.yml: this branch's lookup('resource', ...) refactor;
main's single added literal is already covered by _POSTGRES_MAX_LOCKS_PER_TRANSACTION.

docs/requirements/035-mcp-proxy-expansion.md: this branch moved the design into
ADR 0003, so the requirement keeps only the user story and the criteria. Main's
delta inside the moved block was two new roles, carried into the ADR audit:
web-app-stalwart as adapter_candidate, svc-net-tor-smtp as privileged_control_plane.
The no_surface total said 99 while its own subcategories summed to 112.

inventories/development/default.yml: biber keeps no explicit email. Both sides fixed
the same CI failure; this branch fixed it in _apply_account_defaults, which renders
biber@{{ DOMAIN_PRIMARY }} (utils/cache/users/__init__.py:68) — byte-identical to
the address main hardcoded, so the inventory line is a second copy of one fact.

roles/web-app-{gitlab,keycloak}/files/playwright/playwright.spec.js and
roles/web-app-gitlab/templates/playwright.env.j2: union of both import sets, with
requireDotenvValue kept over decodeDotenvQuotedValue for CANONICAL_DOMAIN because
an empty value must fail rather than match every substring.

The 66 role READMEs take this side: aceb5295ef moved Cosmos, Quick Setup and
Credits to the documentation build, and test_readme.py now rejects them in a
committed README. Main's prose edits inside them are carried over by hand (the
Mailu deprecation banner, Mailu -> Stalwart in erpnext and zammad), and the two
READMEs main added fresh are stripped of the three generated sections.
roles/web-app-sphinx/README.md stays deleted; 6eb9a59d14 merged that role into
web-app-docs. The root README's generated role table was regenerated from the
merged metadata.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-04 01:57:17 +02:00

114 lines
3.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Single entry point for every local deploy flow.
#
# Routing environment variables (set them via `make compose-deploy<short>=<value>`;
# `make compose-deploy` maps the short Make variables to the INFINITO_* env vars):
# mode initialize (default) | reinstall | update
# Short Make alias: mode.
# bundles optional. Comma-separated bundle names. When
# set, routes to bundles/fresh.sh (initialize
# or reinstall) or bundles/update.sh (update).
# apps is ignored in this case (it
# gets resolved from the bundles).
# apps optional. Comma-separated app ids. When set
# (and bundles is not), routes to the
# selection.sh of the chosen verb.
# Short Make alias: apps
# purge true | false (default: false). When true and
# apps is set, runs the entity purge
# before the deploy.
# Short Make alias: purge
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../.." && pwd)"
cd "${REPO_ROOT}"
mkdir -p build
echo $$ >build/deploy.pid
MODE="${mode:-initialize}" # nocheck: deploy router knob; routes to apps/<verb>/ subscripts
PURGE="${purge:-false}" # nocheck: deploy router knob; gates entity pre-purge
printf '=== compose-deploy: mode=%s apps=%s bundles=%s variant=%s full_cycle=%s purge=%s disable=%s playwright_keep=%s\n' \
"${MODE}" "${apps:-}" "${bundles:-}" "${variant:-}" "${full_cycle:-false}" \
"${PURGE}" "${disable:-}" "${INFINITO_PLAYWRIGHT_KEEP:-}"
case "${MODE}" in
initialize | reinstall | update) ;;
*)
echo "ERROR: invalid mode='${MODE}' (must be initialize|reinstall|update)" >&2
exit 2
;;
esac
TORN_DOWN_MARKER="${REPO_ROOT}/.stack-torn-down"
if [[ "${MODE}" == "update" ]] && [[ "${PURGE}" != "true" ]] &&
[[ -f "${TORN_DOWN_MARKER}" ]]; then
cat >&2 <<-EOF
ERROR: refusing mode=update against a torn-down stack.
$(cat "${TORN_DOWN_MARKER}")
An update deploys onto whatever is running. With the subjects down it
fails on a symptom of the teardown - a missing redis, an empty database
- and not on whatever broke the run that left them down. Fixing that
symptom fixes nothing.
Re-run with purge=true to clear the entity state first, or with
mode=reinstall for a fresh baseline. Both remove ${TORN_DOWN_MARKER}.
EOF
exit 1
fi
rm -f "${TORN_DOWN_MARKER}"
run_pre_purge() {
if [[ "${PURGE}" == "true" ]]; then
echo ">>> Pre-purging entities for apps=${apps}"
bash scripts/tests/deploy/local/purge/entity.sh
fi
}
if [[ -n "${bundles:-}" ]]; then
case "${MODE}" in
initialize | reinstall)
target="${SCRIPT_DIR}/bundles/fresh.sh"
;;
update)
target="${SCRIPT_DIR}/bundles/update.sh"
;;
esac
elif [[ -n "${apps:-}" ]]; then
case "${MODE}" in
initialize)
run_pre_purge
exec bash "${SCRIPT_DIR}/apps/initialize/selection.sh" "${apps}"
;;
reinstall)
run_pre_purge
target="${SCRIPT_DIR}/apps/reinstall/selection.sh"
;;
update)
run_pre_purge
target="${SCRIPT_DIR}/apps/update/selection.sh"
;;
esac
else
case "${MODE}" in
initialize)
echo "=== local full deploy (distro=${INFINITO_DISTRO}) ==="
target="${SCRIPT_DIR}/apps/initialize/all.sh"
;;
reinstall)
echo "ERROR: mode=reinstall requires apps= or bundles=" >&2
exit 2
;;
update)
target="${SCRIPT_DIR}/apps/update/all.sh"
;;
esac
fi
exec bash "${target}"