chore(docker+register): refuse worktree deploys (relative bind mounts rehome rig data — register row 68); record row 67 (startup reconcile stores config but starts no InstanceActor) + row-48 postscript

This commit is contained in:
Joseph Doherty
2026-08-15 12:18:01 -04:00
parent 002299c400
commit ef876b38c5
3 changed files with 22 additions and 1 deletions
+11
View File
@@ -3,6 +3,17 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# The compose file's bind mounts are RELATIVE (./site-a-node-a/data etc.), so running
# this script from a git worktree silently rehomes every node's data directory to the
# worktree's copy — the rig keeps running, but its SQLite stores split from the main
# checkout's and all state written there is lost on the next deploy from main.
if [[ "$SCRIPT_DIR" == *"/.claude/worktrees/"* && "${SCADABRIDGE_ALLOW_WORKTREE_DEPLOY:-}" != "1" ]]; then
echo "ERROR: refusing to deploy from a git worktree ($SCRIPT_DIR)." >&2
echo "Bind-mount data dirs would rehome to the worktree copy and split rig state." >&2
echo "Deploy from the main checkout, or set SCADABRIDGE_ALLOW_WORKTREE_DEPLOY=1 to override." >&2
exit 1
fi
echo "=== ScadaBridge Docker Deploy ==="
# Build image (creates network if needed)