Repo root keeps only README.md; DOCS.md and DB_SCHEMA.md move to docs/ with their cross-references updated. The chat-session handoff packets land in docs/handoff/ as point-in-time records with a README marking the repo docs as the live source of truth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2.7 KiB
2.7 KiB
deploy.sh — what it is and how it behaves
An interactive wrapper around the repo's setup.sh. Its job: reconcile
host-specific values in .env for THIS host before setup.sh renders
config from them, then bring the stack up in stages. It exists because copying
a populated .env between hosts silently propagates stale values (see
02-FINDINGS.md, finding 2/3).
Flow (what happens on a run)
- Detect host type (WSL vs native Linux); let user override.
- Guard: refuse/warn if the active daemon is Docker Desktop (bind mounts break under it — see findings).
- Resolve deployment type (menu with descriptions + resource estimates).
- Resolve
HOST_IP(internal bind), router-facing IP+port (separate — whatbmp servertargets), auth mode, and forremotetype the central Kafka. - On WSL: auto-detect the Windows LAN IP via
powershell.exeinterop for the router-facing default (with graceful fallback to a placeholder). - Port-collision preflight — checks host ports the type will bind (ss/netstat//proc), warns/refuses on conflict.
- Show a plan; one confirmation.
- Write reconciled values to
.env. - Clear stale volume handles → run
setup.sh→ verify bind dirs exist → clear handles again → staged bring-up → verify. - Print post-deploy notes (WSL: netsh portproxy commands; native: firewall +
router
bmp serversnippet).
Deployment types (also in DEPLOYMENT-TYPES.md)
full-stack— collector + Kafka + Postgres + Grafana + feeders, one host.remote— collector + local Kafka only, forwards to a central store's Kafka. Needs--central-kafka HOST:PORT. No local store.central-store— store + Grafana + feeders, NO local collector; ingest via remotes.
Old scope names (core/feeders/full/standalone) are accepted as aliases.
Flags
--wsl|--prod, --host-ip, --router-ip, --router-port (default 1790,
the IANA BMP port — collector still listens 5000 internally, mapped),
--auth local|authelia, --scope full-stack|remote|central-store,
--central-kafka HOST:PORT, --reset, --yes.
Notes for repo integration
- It calls
./setup.shand checks its exit status. It does NOT reimplement setup.sh's provisioning — it drives it with correct inputs. - It assumes
.env.example,setup.sh,docker-compose.ymlare in the same dir. Ifsetup.shkey names change, update deploy.sh'sget_env/set_envreferences. - Router port default was changed to 1790; the lab routers are currently
configured to send BMP to 5000, so until they're reconfigured, deploy
with
--router-port 5000OR update the routers. This is an open decision (see 03-NEXT-STEPS.md).