The droplet's cron ran /usr/local/bin/wizwar-backup.sh while the repo improved deploy/wizwar-backup.sh — two copies, no bridge, and the Sentry check-ins never reached the box, so the cron monitor starved and alarmed on 2026-09-02. Every deploy now installs the repo copy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
24 lines
981 B
Bash
Executable File
24 lines
981 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build locally, push to the droplet, restart. Usage: deploy/deploy.sh <droplet-ip>
|
|
set -euo pipefail
|
|
HOST="${1:?usage: deploy.sh <droplet-ip-or-host>}"
|
|
|
|
npm run build --workspace=@wizwar/web
|
|
rsync -az --delete \
|
|
--exclude node_modules --exclude data/ --exclude .git --exclude research \
|
|
./ "root@$HOST:/opt/wizwar/"
|
|
ssh "root@$HOST" '
|
|
cd /opt/wizwar && npm install --no-audit --no-fund
|
|
chown -R wizwar:wizwar /opt/wizwar
|
|
cp /opt/wizwar/deploy/wizwar.service /etc/systemd/system/wizwar.service
|
|
# The backup script is cron-run from /usr/local/bin — install it every
|
|
# deploy, or the repo copy and the live copy drift apart (they did:
|
|
# the Sentry check-ins shipped in the repo and never reached the box).
|
|
install -m 755 /opt/wizwar/deploy/wizwar-backup.sh /usr/local/bin/wizwar-backup.sh
|
|
systemctl daemon-reload
|
|
systemctl enable --now wizwar
|
|
systemctl restart wizwar
|
|
systemctl --no-pager -l status wizwar | head -5
|
|
'
|
|
echo "deployed."
|