feat(1d): G3 — custom install-steps hook + graceful-generic (DG5) + DG3 N/A-skip demo
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>
This commit is contained in:
28
tests/custom-html-tiny/install_steps.sh
Executable file
28
tests/custom-html-tiny/install_steps.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/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})"
|
||||
5
tests/custom-html-tiny/recipe_meta.py
Normal file
5
tests/custom-html-tiny/recipe_meta.py
Normal file
@ -0,0 +1,5 @@
|
||||
# Per-recipe config for custom-html-tiny (a fast static-web-server). Shorter timeouts than the
|
||||
# defaults: it converges + serves in seconds, so the generic install's fail-without-hook case
|
||||
# (DG5) is detected quickly instead of waiting the default 300s HTTP timeout.
|
||||
DEPLOY_TIMEOUT = 120
|
||||
HTTP_TIMEOUT = 90
|
||||
Reference in New Issue
Block a user