#!/usr/bin/env bash # ghost — INSTALL-TIME hook (Phase 2 F2-14b). 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 start_period-grace overlay (compose.ccci.yml) to the recipe checkout so # the UPGRADE-tier BASE deploy (a previous published version whose app healthcheck still ships the # too-tight 1m start_period) can survive ghost's ~6-9min fresh-DB migration and converge. See # compose.ccci.yml's header for the full rationale. The overlay is referenced by recipe_meta # COMPOSE_FILE; copying it here (it is a cc-ci file, not part of the recipe) makes it resolvable. # It persists across the later `git checkout ` (untracked) so the head deploy also merges it # (idempotent — the PR head already ships 15m). CHAOS_BASE_DEPLOY=True is set so abra's pinned-deploy # clean-tree check doesn't FATA on the untracked 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 " ghost 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 " ghost install_steps: provided compose.ccci.yml (app start_period grace) to recipe checkout (${CCCI_RECIPE})"