← back to Goldleafwallpaper
auto-save: 2026-07-14T13:01:14 (2 files) — scripts/rebuild-and-deploy.sh scripts/refresh-metalleaf-fleet.sh
1fd1307933ca38e5ac61c3c04825cb3c75686ce2 · 2026-07-14 13:01:19 -0700 · Steve Abrams
Files touched
A scripts/rebuild-and-deploy.shA scripts/refresh-metalleaf-fleet.sh
Diff
commit 1fd1307933ca38e5ac61c3c04825cb3c75686ce2
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Jul 14 13:01:19 2026 -0700
auto-save: 2026-07-14T13:01:14 (2 files) — scripts/rebuild-and-deploy.sh scripts/refresh-metalleaf-fleet.sh
---
scripts/rebuild-and-deploy.sh | 30 ++++++++++++++++++++++++++++++
scripts/refresh-metalleaf-fleet.sh | 20 ++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/scripts/rebuild-and-deploy.sh b/scripts/rebuild-and-deploy.sh
new file mode 100755
index 0000000..ed0612b
--- /dev/null
+++ b/scripts/rebuild-and-deploy.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# rebuild-and-deploy.sh — refresh goldleafwallpaper.com's RML- feed from the
+# local dw_unified mirror and push it live. Idempotent; safe to run any time.
+#
+# 1. rebuild data/products.json from dw_unified (ACTIVE RML- only)
+# 2. rsync it to the Kamatera static site
+# 3. pm2 restart so the (static) server reloads the file
+# 4. verify the live count over HTTPS
+#
+# Run manually, or nightly via launchd (com.steve.metalleaf-rml-refresh).
+set -euo pipefail
+
+REPO="$(cd "$(dirname "$0")/.." && pwd)"
+REMOTE="/root/Projects/Designer-Wallcoverings/DW-Websites/GoldLeafWallpaper"
+PM2_PROC="goldleafwallpaper-website"
+HEALTH="https://goldleafwallpaper.com/data/products.json"
+
+cd "$REPO"
+echo "[$(date '+%F %T')] rebuild gold RML- feed"
+node scripts/build-products.js
+
+echo "rsync → Kamatera"
+rsync -az data/products.json "kamatera:$REMOTE/data/products.json"
+
+echo "pm2 restart + verify"
+ssh kamatera "pm2 restart $PM2_PROC >/dev/null 2>&1; sleep 2"
+COUNT=$(curl -s --max-time 20 "$HEALTH" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const a=JSON.parse(s);console.log(a.length)}catch(e){console.log("ERR")}})')
+echo "[$(date '+%F %T')] live count: $COUNT"
+[ "$COUNT" = "ERR" ] && { echo "VERIFY FAILED"; exit 1; }
+echo "done."
diff --git a/scripts/refresh-metalleaf-fleet.sh b/scripts/refresh-metalleaf-fleet.sh
new file mode 100755
index 0000000..f4c0552
--- /dev/null
+++ b/scripts/refresh-metalleaf-fleet.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# refresh-metalleaf-fleet.sh — nightly refresh of BOTH metal-leaf microsites
+# (goldleafwallpaper.com + silverleafwallpaper.com) from the local dw_unified
+# mirror. Each site's rebuild-and-deploy.sh rebuilds data/products.json from the
+# ACTIVE RML- line, rsyncs it, restarts pm2, and verifies the live count.
+#
+# Scheduled by launchd com.steve.metalleaf-rml-refresh (daily 07:00 — after the
+# 06:00 dw-shopify-products-sync populates the mirror). One site failing does not
+# abort the other; the exit code is non-zero if EITHER fails, so launchd logs it.
+set -u
+
+GOLD="$HOME/Projects/goldleafwallpaper/scripts/rebuild-and-deploy.sh"
+SILVER="$HOME/Projects/silverleafwallpaper/scripts/rebuild-and-deploy.sh"
+rc=0
+
+echo "===== metal-leaf RML refresh $(date '+%F %T') ====="
+bash "$GOLD" || { echo "GOLD refresh FAILED"; rc=1; }
+bash "$SILVER" || { echo "SILVER refresh FAILED"; rc=1; }
+echo "===== done (rc=$rc) ====="
+exit $rc
← 698fb06 Fix dead filter chips: replace Bronze/Foil/Lacquer/Black/Met
·
back to Goldleafwallpaper
·
Fix sample/inquiry forms: send George X-Send-Approval token 57e5e4e →