31 lines
1.4 KiB
Bash
Executable File
31 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deploy Record Store Guy to monsterrobot.games/games/recordstoreguy/
|
|
# Pattern: the game dir is a READ-ONLY bind mount into forum-nginx, so we rsync
|
|
# to the HOST path directly (no docker cp, no nginx reload needed for static files).
|
|
# Covers live in the lander's covers/ dir; the tile is added to index.html by hand
|
|
# (see README / the tile block below), backed up first.
|
|
set -euo pipefail
|
|
|
|
HOST="humanjing@100.71.119.27"
|
|
BASE="/home/humanjing/monsterrobot.games"
|
|
DEST="$BASE/games/recordstoreguy"
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
echo "== 1. sync engine → $DEST"
|
|
rsync -az --delete \
|
|
--exclude='.DS_Store' \
|
|
"$HERE/engine/" "$HOST:$DEST/"
|
|
|
|
echo "== 2. covers"
|
|
scp -q "$HERE/deploy-assets/recordstoreguy.jpg" "$HERE/deploy-assets/recordstoreguy_riso.jpg" \
|
|
"$HOST:$BASE/covers/"
|
|
|
|
echo "== 3. verify live (cache-busted)"
|
|
sleep 1
|
|
code=$(curl -s -o /dev/null -w '%{http_code}' "https://monsterrobot.games/games/recordstoreguy/?cb=$RANDOM")
|
|
title=$(curl -s "https://monsterrobot.games/games/recordstoreguy/?cb=$RANDOM" | grep -oiE '<title>[^<]*' | head -1)
|
|
clip=$(curl -s -o /dev/null -w '%{http_code}' "https://monsterrobot.games/games/recordstoreguy/clips/intro.mp4?cb=$RANDOM")
|
|
echo " index: HTTP $code $title"
|
|
echo " intro.mp4: HTTP $clip"
|
|
[ "$code" = 200 ] && [ "$clip" = 200 ] && echo "== DEPLOYED OK" || { echo "!! verify failed"; exit 1; }
|