tests/custom-html-tiny/install_steps.sh seeds content into the volume pre-deploy. Proof: install FAILS without the hook (404, graceful-generic), PASSES with it. Same run shows backup/restore=skip (custom-html-tiny non-backup-capable) — DG3 N/A-skip. deploy-count=1. recipe_meta shortens timeouts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
1.4 KiB
Bash
Executable File
29 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Custom install-steps hook for custom-html-tiny (Phase 1d DG5).
|
|
#
|
|
# custom-html-tiny is a static-web-server that serves from an (otherwise EMPTY) `content` volume, so
|
|
# the GENERIC install legitimately fails 404 with zero config — that is the correct, reported
|
|
# graceful-generic outcome (a recipe needing a step fails the generic, you fix it by adding a step).
|
|
# This hook is that step: it pre-seeds an index.html into the app's content volume BEFORE deploy, so
|
|
# the app actually serves. With this hook present the generic install passes; remove it and the
|
|
# generic install fails again — demonstrating the hook + the graceful-generic rule both real.
|
|
#
|
|
# Runs on cc-ci (root) after `abra app new` + env, before `abra app deploy`. Env: CCCI_APP_DOMAIN,
|
|
# CCCI_RECIPE, CCCI_APP_ENV. Writes straight to the swarm volume's mountpoint (no container/image
|
|
# pull). The volume is created here so it exists when the stack deploys (swarm reuses a named volume).
|
|
set -euo pipefail
|
|
|
|
stack="${CCCI_APP_DOMAIN//./_}"
|
|
vol="${stack}_content"
|
|
|
|
docker volume create "$vol" >/dev/null
|
|
mountpoint="$(docker volume inspect "$vol" --format '{{.Mountpoint}}')"
|
|
cat >"${mountpoint}/index.html" <<'HTML'
|
|
<!doctype html>
|
|
<html><body>
|
|
<h1>cc-ci custom-html-tiny</h1>
|
|
<p>content seeded by install_steps.sh (custom install-steps hook, DG5)</p>
|
|
</body></html>
|
|
HTML
|
|
echo "install_steps: seeded index.html into volume ${vol} (${mountpoint})"
|