#!/usr/bin/env bash # discourse — INSTALL-TIME hook (Phase 2 Q4.6). Runs during the install tier AFTER `abra app new` + # EXTRA_ENV + `abra app secret generate` and BEFORE the single `abra app deploy` # (lifecycle.py::_run_install_steps), with CCCI_RECIPE / CCCI_APP_DOMAIN in env. # # Purpose: provide the cc-ci re-pin+grace overlay (compose.ccci.yml) to the recipe checkout so the # UPGRADE-tier BASE deploy (published 0.7.0+3.3.1, whose compose pins the Docker-Hub-removed # `bitnami/discourse:3.3.1` and ships a too-tight 5m start_period) is deployable and can survive the # 15-25min Rails cold boot — so upgrade-to-latest can run. See compose.ccci.yml's header for the full # rationale. The overlay is referenced by recipe_meta COMPOSE_FILE; it is a cc-ci file (not part of the # recipe), so copying it here makes it resolvable. It persists across the later `git checkout ` # (untracked) so the head deploy also merges it (idempotent — the PR head already re-pins + ships 20m). # CHAOS_BASE_DEPLOY=True is set so abra's pinned-deploy clean-tree check doesn't FATA on the overlay. set -euo pipefail : "${CCCI_RECIPE:?missing CCCI_RECIPE}" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" RECIPE_DIR="${HOME}/.abra/recipes/${CCCI_RECIPE}" if [ ! -d "$RECIPE_DIR" ]; then echo " discourse install_steps: recipe dir $RECIPE_DIR missing — cannot provide compose.ccci.yml" >&2 exit 1 fi cp "$SCRIPT_DIR/compose.ccci.yml" "$RECIPE_DIR/compose.ccci.yml" echo " discourse install_steps: provided compose.ccci.yml (bitnamilegacy re-pin + 20m start_period grace) to recipe checkout (${CCCI_RECIPE})"