Submatter/scripts/ct116-post-migration.sh
Randall Stillwell 9bde5960bf
Some checks failed
CI / Lint, type-check, test (push) Has been cancelled
Deploy homelab (CT 116) / Deploy to CT 116 (push) Has been cancelled
fix(deploy): collab URL, CT 116 prod compose, Forgejo migration
- Read NEXT_PUBLIC_COLLAB_SERVER_URL in yjs provider; bake NEXT_PUBLIC_* at Docker build
- Add prod compose, deploy scripts, CT 116 proxmox scaffolding
- Forgejo Actions CI/deploy; migrate-origin and post-migration scripts
2026-09-08 22:33:59 -05:00

46 lines
1.4 KiB
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Operator runbook — run ON CT 116 after Forgejo migration + env updates.
# Copy-paste from your laptop:
# ssh root@192.168.68.116 'bash -s' < scripts/ct116-post-migration.sh
#
# Or on CT 116 directly:
# cd /opt/submatter && bash scripts/ct116-post-migration.sh
set -euo pipefail
APP_DIR="${APP_DIR:-/opt/submatter}"
cd "$APP_DIR"
echo "=== CT 116 post-migration ==="
if [[ -f scripts/migrate-origin-to-forgejo.sh ]]; then
bash scripts/migrate-origin-to-forgejo.sh
else
echo "WARN: migrate-origin-to-forgejo.sh missing — pull latest main first"
git fetch origin main && git checkout main && git reset --hard origin/main
fi
if grep -q '^NEXT_PUBLIC_COLLAB_SERVER_URL=ws://' .env 2>/dev/null; then
echo ""
echo "ACTION REQUIRED: update .env collab URLs to wss:// before deploy:"
echo " NEXT_PUBLIC_COLLAB_SERVER_URL=wss://collab.echodo.stillwell.cloud"
echo " COLLAB_SERVER_URL=wss://collab.echodo.stillwell.cloud"
echo ""
fi
missing=()
for var in OMNIROUTE_BASE_URL OMNIROUTE_API_KEY FORGEJO_TOKEN; do
if ! grep -q "^${var}=" .env 2>/dev/null; then
missing+=("$var")
fi
done
if ((${#missing[@]} > 0)); then
echo "Optional .env vars not set (add when ready): ${missing[*]}"
fi
echo ""
echo "=== deploying (serialized build — may take 15–30 min) ==="
bash scripts/deploy-prod.sh build
echo ""
echo "=== health ==="
docker compose -f docker/docker-compose.prod.yml -f docker/docker-compose.prod.standalone.yml ps