mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 19:56:53 +00:00
The drop and truncate helpers ended with `[[ $rc -ne 0 ]] && warn`, which returns 1 when the command succeeded. The per-stack subshell runs on the left of `||`, where set -e is suspended, so its status is that of the last helper: every successful MariaDB drop printed "DB purge failed (rc=1)" and the script exited 1. The helpers now end with an if statement, which returns 0 when nothing failed and still warns when something did. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Entity Purge 🗑️
Entity-keyed purge primitives for stack-level cleanup inside the running container.
For the canonical Make target index that invokes these helpers, see make.md.
Entry Points 🎯
| Script | What it does | Key inputs |
|---|---|---|
compose.sh |
Stops the compose stack and removes volumes. | Stack names |
db.sh |
Drops or truncates the backing database. | Stack names, --wipe-data-only |
dir.sh |
Removes the stack directory and its volumes. | Stack names |
nginx.sh |
Removes the per-domain nginx vhost files (http + https) belonging to every app under the entity. Thin wrapper around nginx_vhosts.py. | Stack names |
network.sh |
Drops the per-entity default Docker network when compose.sh left it behind with the wrong / empty com.docker.compose.network label (typical between matrix-deploy rounds). Skips removal when the network still has active container endpoints, so shared-service networks (svc-db-mariadb, svc-db-postgres, …) stay in place while their provider container is up. The global docker network prune -f sweep that catches orphans whose names do NOT match the entity is run once by the orchestrator apps.sh after the entity loop. Idempotent. |
Stack name |
These primitives are entity-keyed. The app-keyed orchestrator apps.sh maps app ids to entities and drives them in sequence alongside the token-store wipe in tokens.py.