Files
pyre/scripts/deploy-status.sh
RogueWave a294a8a9fb chore(status): mark Phase 0 complete; add deploy-status.sh
Server provisioning ran successfully: nginx + PostgreSQL + Redis live, UFW
active (22/2222/80/443), TLS issued for feedthepyre.com (+www), pm2-pyre
service enabled. Status dashboard updated (Phase 0 done; infra all green).
Adds scripts/deploy-status.sh for friction-free status-page redeploys.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 02:48:38 +00:00

31 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# =============================================================================
# Regenerate the PYRE dev-status page and deploy it to the nginx webroot.
# =============================================================================
# Usage: bash scripts/deploy-status.sh
#
# Workflow: edit infra/status/status.json -> run this -> the live page at
# https://feedthepyre.com updates.
#
# After a ONE-TIME `sudo chown -R pyre:pyre /var/www/feedthepyre`, this runs
# WITHOUT sudo (nginx/www-data still serves the world-readable files fine).
# Until then, run it with sudo.
# =============================================================================
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
WEBROOT="/var/www/feedthepyre/status"
node "${REPO_DIR}/scripts/gen-status.mjs"
if [[ -d "${WEBROOT}" && -w "${WEBROOT}" ]]; then
install -m 0644 "${REPO_DIR}/infra/status/index.html" "${WEBROOT}/index.html"
install -m 0644 "${REPO_DIR}/infra/status/status.json" "${WEBROOT}/status.json"
echo "Deployed status page -> ${WEBROOT}"
else
echo "ERROR: ${WEBROOT} is missing or not writable by '$(whoami)'." >&2
echo "Run this script with sudo, OR make updates sudo-free once with:" >&2
echo " sudo chown -R pyre:pyre /var/www/feedthepyre" >&2
exit 1
fi