Files
wizwar6e/deploy/deploy.sh
T
Eric WagonerandClaude Fable 5.1 2b5c2c4884 The visitors digest: who is here, who came today, how far they got
/usr/local/bin/wizwar-visitors.sh prints one screen — live sockets and
rooms touched in the hour, today's traffic row, the names seated today
with the first-time ones marked, every room opened today with its
state, move counts, span, and last human move, humans' chat verbatim,
and the desk's count — and the wizwar-visitors skill reads it aloud.
It replaces the four hand-written versions of the same report from
announcement day.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
2026-09-03 18:58:53 -04:00

26 lines
1.1 KiB
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
# Cron runs the backup and the rollup from /usr/local/bin: install
# them on every deploy so the live copies are always the repo copies.
install -m 755 /opt/wizwar/deploy/wizwar-backup.sh /usr/local/bin/wizwar-backup.sh
install -m 755 /opt/wizwar/deploy/wizwar-rollup.sh /usr/local/bin/wizwar-rollup.sh
install -m 755 /opt/wizwar/deploy/wizwar-visitors.sh /usr/local/bin/wizwar-visitors.sh
install -m 644 /opt/wizwar/deploy/wizwar-rollup.cron /etc/cron.d/wizwar-rollup
systemctl daemon-reload
systemctl enable --now wizwar
systemctl restart wizwar
systemctl --no-pager -l status wizwar | head -5
'
echo "deployed."