The hall comes first, in the shape of wizwar's landing
The home page is a centred card: title and pitch, your name, play the bot or continue the duel under way, create or join a duel by code, a sample ledger, the duels this browser holds with whose move it is, and the story of the game. The single-player board lives at /play. The droplet gains the duel server as a systemd service behind Caddy. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
e1bda87987
commit
6c6edca4be
+22
-5
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build locally and push the static site to the droplet.
|
||||
# Usage: deploy/deploy.sh <droplet-ip-or-host>
|
||||
# Build locally, push the static site and the duel server to the droplet,
|
||||
# and restart the server. Usage: deploy/deploy.sh <droplet-ip-or-host>
|
||||
set -euo pipefail
|
||||
HOST="${1:?usage: deploy.sh <droplet-ip-or-host>}"
|
||||
|
||||
npm run check
|
||||
npm run check:server
|
||||
npm test
|
||||
npm run build
|
||||
|
||||
@@ -12,11 +13,27 @@ npm run build
|
||||
# fetch the module it was built against instead of failing mid-duel.
|
||||
rsync -az --delete --filter='P _app/immutable/*' \
|
||||
build/ "root@$HOST:/opt/waving-hands/build/"
|
||||
|
||||
# The server runs from source with tsx; it needs the engine, its own code,
|
||||
# and the dependency manifest. Ledgers live outside this tree and survive.
|
||||
rsync -az --delete \
|
||||
--include='/server/***' --include='/src/' --include='/src/lib/' --include='/src/lib/game/***' \
|
||||
--include='/package.json' --include='/package-lock.json' --include='/deploy/' --include='/deploy/waving-hands.service' \
|
||||
--exclude='*' \
|
||||
./ "root@$HOST:/opt/waving-hands/app/"
|
||||
|
||||
ssh "root@$HOST" '
|
||||
find /opt/waving-hands/build/_app/immutable -type f -mtime +7 -delete
|
||||
chown -R root:caddy /opt/waving-hands
|
||||
chmod -R g+rX /opt/waving-hands
|
||||
chown -R root:caddy /opt/waving-hands/build
|
||||
chmod -R g+rX /opt/waving-hands/build
|
||||
cd /opt/waving-hands/app && npm install --no-audit --no-fund --omit=optional
|
||||
chown -R waving-hands:waving-hands /opt/waving-hands/app
|
||||
cp /opt/waving-hands/app/deploy/waving-hands.service /etc/systemd/system/waving-hands.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now waving-hands
|
||||
systemctl restart waving-hands
|
||||
systemctl reload caddy
|
||||
systemctl --no-pager -l status caddy | head -3
|
||||
sleep 1
|
||||
systemctl --no-pager -l status waving-hands | head -3
|
||||
'
|
||||
echo "deployed."
|
||||
|
||||
Reference in New Issue
Block a user