feat(infra): add dev.sh wrapper for the local-dev compose stack #68
Reference in New Issue
Block a user
Delete Branch "feat/infra/dev-sh-wrapper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two recurring frictions on the local-dev stack:
docker compose downonly operates on services whose profile is currently active. Anything brought up with--profile Xkeeps running unless the same flag is passed ondown. pgweb and Jaeger silently survived severaldown -vinvocations before we noticed (#67 documented the gotcha; this PR makes it impossible to hit if you use the wrapper).docker compose -f infra/local/dev.compose.yml --profile … <verb>for routine ops gets old fast.Add
infra/local/dev.shas a thin wrapper. Always passes every profile in scope on teardown / status / log commands, exposes ergonomic verbs:./infra/local/dev.sh up./infra/local/dev.sh up all./infra/local/dev.sh up dbtools./infra/local/dev.sh up observability./infra/local/dev.sh down [-v]./infra/local/dev.sh stop <service>./infra/local/dev.sh restart <service>./infra/local/dev.sh statuspswith every profile visible./infra/local/dev.sh logs [service]./infra/local/dev.sh exec <service> <cmd>Anything not matching one of the named verbs is passed through to
docker compose -f dev.compose.yml ...(with every profile flagged in), so the full Compose surface remains available.Doc updates
infra/README.md— new "Convenience script" subsection with the cheat-sheet table; "First-time setup" rewritten to use the script; the standalone "Profile symmetry" tip from #67 is collapsed into a one-liner since the script now handles it (the note remains as a fallback for directdocker composeusers).docs/development.md§3 — points at the script for the typical setup flow.The compose file itself is unchanged.
Test plan
./infra/local/dev.sh helpprints the usage block../infra/local/dev.sh upbrings up the 3 core services (no pgweb / no jaeger)../infra/local/dev.sh up alladds pgweb and Jaeger../infra/local/dev.sh down -vstops and removes all 5 containers (incl. pgweb and Jaeger), wipes the postgres-data and redis-data volumes../infra/local/dev.sh stop pgwebstops just pgweb../infra/local/dev.sh logs otel-collectorfollows that service's logs../infra/local/dev.sh exec postgres psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\du"lists the audit roles../infra/local/dev.sh stop(no arg) errors with a clear message.