Wire opt-in Stage runtime provisioning before isolated render; verify snapshot and Compose integration

This commit is contained in:
devops committed 2026-10-23 18:15:47 +00:00
1 parent bf84e5da43
commit 105ab07fbd
3 files changed
+205 -1

No files matched your search

+12 -1
View File
@@ -29,8 +29,16 @@ git cat-file -e "${DEPLOY_SHA}^{commit}"
git merge-base --is-ancestor "$DEPLOY_SHA" origin/develop
git checkout --detach "$DEPLOY_SHA"
[ "$(git rev-parse HEAD)" = "$DEPLOY_SHA" ]
# Provision against the pristine approved SHA, before any tracked render edits.
source scripts/rollout-stage.sh
if [ "${STAGE_PROVISION_ENABLED:-false}" = true ]; then
stage_runtime_provision
elif [ -e /opt/services/canina/stage-runtime ]; then
echo 'ERROR: existing runtime requires explicit Stage CI opt-in on every deploy' >&2
exit 2
fi
# Keep operational files out of status/accidental commits in this disposable clone.
printf '\n.support-chat.env\n.revalidation.env\n.stage-base.json\n.stage-compose.json\n' >> .git/info/exclude
printf '\n.support-chat.env\n.revalidation.env\n.stage-base.json\n.stage-compose.json\n.stage-runtime.json\n.stage-runtime-merged.json\n' >> .git/info/exclude
# Runtime secrets/config must never enter the frontend Docker build context.
printf '\n.support-chat.env\n.revalidation.env\n.stage-*.json\n' >> .dockerignore
# Only these backend/frontend runtime env files are required. Do not copy the
@@ -92,6 +100,9 @@ for service in config['services'].values():
Path('.stage-compose.json').write_text(json.dumps(config))
Path('.stage-base.json').unlink()
PY
if [ "${STAGE_PROVISION_ENABLED:-false}" = true ]; then
stage_runtime_render
fi
# Read-only checks: missing external storage must fail, never provision blank DB.
docker volume inspect stage_canina_stage_db stage_canina_stage_uploads >/dev/null
docker network inspect traefik_public >/dev/null