Preview — /opt/jfmsrv01/scripts/publish_site_preview.sh

/opt/jfmsrv01/scripts/publish_site_preview.sh

#!/usr/bin/env bash
set -euo pipefail
SLUG="vqngx6j8dc9q1lvt7g2a7a646q2t"
SITE="${1:-twin-fin}"
SRC="/var/www/sites/${SITE}"
PORTAL_ROOT="/var/www/handoff/public/${SLUG}"
DST="${PORTAL_ROOT}/sites/${SITE}"
[ -d "$SRC" ] || { echo "ERROR: $SRC not found — run publish_build in GoSeek first"; exit 1; }
mkdir -p "$DST"
rsync -a --delete "$SRC"/ "$DST"/
chown -R --reference="$PORTAL_ROOT" "$DST"
echo "Published: https://${SLUG}.jfmcommunications.com.au/${SLUG}/sites/${SITE}/index.html"