#!/usr/bin/env bash # Deploy RareIndex to the MacLustr cluster through the mld gateway (M1M32). # Usage: scripts/deploy.sh [--node M3U96a] # Manifest: M1M32:~/dispatch/apps/rareindex.json (secrets live there, never in the repo). set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" MLD="$HOME/Desktop/cluster-skill/mld" NODE_ARG=() if [[ "${1:-}" == "--node" && -n "${2:-}" ]]; then NODE_ARG=(--node "$2"); fi echo "▶ typecheck + tests" (cd "$ROOT" && pnpm -r --filter './packages/**' run typecheck >/dev/null && pnpm test >/dev/null) || { echo "✗ checks failed"; exit 1; } echo "▶ registry" (cd "$ROOT" && pnpm tsx scripts/build-registry.ts) echo "▶ stage → gateway" "$MLD" stage "$ROOT" rareindex echo "▶ deploy" "$MLD" deploy rareindex "${NODE_ARG[@]}" echo "▶ status" "$MLD" status | grep -E "^app|rareindex" || true