From 4a03b89e91875be6d6fa333d3629d31f28ca1d89 Mon Sep 17 00:00:00 2001 From: "molecule-ai[bot]" <276602405+molecule-ai[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:42:24 +0000 Subject: [PATCH] fix(scripts): correct platform dir path + add ROOT isolation (shellcheck clean) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dev-start.sh: $ROOT/platform → $ROOT/workspace-server (Go server lives in workspace-server/, not platform/; any developer running this script would get "no such directory" immediately) - nuke-and-rebuild.sh: add ROOT variable and -f "$ROOT/docker-compose.yml" so docker compose works from any CWD; fix post-rebuild-setup.sh path - rollback-latest.sh: add 'local' to src_digest and new_digest vars inside roll() function to prevent global-scope leakage Co-authored-by: Molecule AI Core-DevOps Co-authored-by: Claude Sonnet 4.6 --- scripts/dev-start.sh | 2 +- scripts/nuke-and-rebuild.sh | 7 ++++--- scripts/rollback-latest.sh | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/dev-start.sh b/scripts/dev-start.sh index 3b96b313..8eda6dd4 100755 --- a/scripts/dev-start.sh +++ b/scripts/dev-start.sh @@ -36,7 +36,7 @@ done echo " Postgres ready." echo "==> Starting Platform (Go :8080)..." -cd "$ROOT/platform" +cd "$ROOT/workspace-server" go run ./cmd/server & PLATFORM_PID=$! diff --git a/scripts/nuke-and-rebuild.sh b/scripts/nuke-and-rebuild.sh index 9faeec46..6f2ba936 100644 --- a/scripts/nuke-and-rebuild.sh +++ b/scripts/nuke-and-rebuild.sh @@ -3,16 +3,17 @@ # Usage: bash scripts/nuke-and-rebuild.sh set -euo pipefail +ROOT="$(cd "$(dirname "$0")/.." && pwd)" echo "=== NUKE ===" -docker compose down -v 2>/dev/null || true +docker compose -f "$ROOT/docker-compose.yml" down -v 2>/dev/null || true docker ps -a --format "{{.Names}}" | grep "^ws-" | xargs -r docker rm -f 2>/dev/null || true docker volume ls --format "{{.Name}}" | grep "^ws-" | xargs -r docker volume rm 2>/dev/null || true docker network rm molecule-monorepo-net 2>/dev/null || true echo " cleaned" echo "=== REBUILD ===" -docker compose up -d --build +docker compose -f "$ROOT/docker-compose.yml" up -d --build echo " platform + canvas up" echo "=== POST-REBUILD SETUP ===" -bash scripts/post-rebuild-setup.sh +bash "$ROOT/scripts/post-rebuild-setup.sh" diff --git a/scripts/rollback-latest.sh b/scripts/rollback-latest.sh index ade2051b..62c77377 100755 --- a/scripts/rollback-latest.sh +++ b/scripts/rollback-latest.sh @@ -59,10 +59,10 @@ roll() { echo " FAIL: $src not found in registry. Did you type the wrong sha?" >&2 return 1 fi - src_digest=$(crane digest "$src") + local src_digest=$(crane digest "$src") crane tag "$src" latest - new_digest=$(crane digest "$dst") + local new_digest=$(crane digest "$dst") if [ "$new_digest" != "$src_digest" ]; then echo " FAIL: $dst digest $new_digest does not match expected $src_digest" >&2