#!/usr/bin/env bash # ===================================================================== # MORPQUEST — Production Deploy (next door to Beyond Morp) # ===================================================================== # Usage: bash deploy.sh [path-to-MRPGI] # # 1. Builds the wasm bundle with this game baked in (MRPGI/web/build.sh) # 2. rsyncs web/dist/ into the host bind-mount /home/humanjing/morpquest # # The game is served at https://partly.party/morpquest/ from a *host # bind-mount* (forum-nginx: /home/humanjing/morpquest -> .../html/morpquest, # added to forum/docker-compose.yml alongside beyondmorp/roguelike/etc.). # Because it's a live bind-mount, an rsync is instantly live — no docker cp, # no reload, no container recreate. (The earlier docker-cp approach wrote to # the container's writable layer and vanished when forum-nginx was recreated; # a bind-mount is the durable pattern every other game here uses.) # # One-time infra already in place on the VPS (humanjing@100.71.119.27): # * forum/docker-compose.yml nginx volumes: # - /home/humanjing/morpquest:/usr/share/nginx/html/morpquest:ro # * forum/nginx/nginx.conf http{} after `include mime.types`: # types { audio/wav wav; } # so the chiptunes serve as audio/wav # Both survive container recreation (compose + bind-mounted conf). # ===================================================================== set -euo pipefail MRPGI="${1:-$HOME/Documents/MRPGI}" GAME="$(cd "$(dirname "$0")" && pwd)" VPS="humanjing@100.71.119.27" REMOTE_DIR="/home/humanjing/morpquest" # rustup's toolchain has the wasm target; homebrew's rust does not. RUSTUP_BIN="$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin" [ -d "$RUSTUP_BIN" ] && export PATH="$RUSTUP_BIN:$PATH" echo "==> building wasm bundle ($GAME baked in)" sh "$MRPGI/web/build.sh" "$GAME" echo "==> rsync web/dist -> $VPS:$REMOTE_DIR (live bind-mount)" ssh "$VPS" "mkdir -p $REMOTE_DIR" rsync -az --delete "$MRPGI/web/dist/" "$VPS:$REMOTE_DIR/" echo "==> deployed live at https://partly.party/morpquest/ — the queue has been waiting since sunrise."