← back to Silverleafwallpaper
auto-save: 2026-07-14T13:01:14 (1 files) — scripts/rebuild-and-deploy.sh
4d7050537fc28b77514ed03b366ef2d754e50f7f · 2026-07-14 13:01:16 -0700 · Steve Abrams
Files touched
A scripts/rebuild-and-deploy.sh
Diff
commit 4d7050537fc28b77514ed03b366ef2d754e50f7f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Jul 14 13:01:16 2026 -0700
auto-save: 2026-07-14T13:01:14 (1 files) — scripts/rebuild-and-deploy.sh
---
scripts/rebuild-and-deploy.sh | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/scripts/rebuild-and-deploy.sh b/scripts/rebuild-and-deploy.sh
new file mode 100755
index 0000000..c4cf072
--- /dev/null
+++ b/scripts/rebuild-and-deploy.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# rebuild-and-deploy.sh — refresh silverleafwallpaper.com's RML- feed from the
+# local dw_unified mirror and push it live. Idempotent; safe to run any time.
+#
+# The live server runs in STATIC MODE (admin-catalog disabled on Kamatera → it
+# reads data/products.json directly), so the whole refresh is: rebuild the file,
+# rsync it, pm2 restart to reload. No dw_unified.microsite_products write needed.
+#
+# 1. rebuild data/products.json from dw_unified (ACTIVE RML- only)
+# 2. rsync it to the Kamatera site
+# 3. pm2 restart so the server reloads the file + re-runs the RML niche filter
+# 4. verify the live count over HTTPS
+set -euo pipefail
+
+REPO="$(cd "$(dirname "$0")/.." && pwd)"
+REMOTE="/var/www/silverleafwallpaper.com"
+PM2_PROC="silverleafwallpaper"
+HEALTH="https://silverleafwallpaper.com/api/products?limit=1"
+
+cd "$REPO"
+echo "[$(date '+%F %T')] rebuild silver 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 3"
+TOTAL=$(curl -s --max-time 20 "$HEALTH" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const j=JSON.parse(s);console.log(j.total)}catch(e){console.log("ERR")}})')
+echo "[$(date '+%F %T')] live total: $TOTAL"
+[ "$TOTAL" = "ERR" ] && { echo "VERIFY FAILED"; exit 1; }
+echo "done."
← 53299c7 Fix dead facet rails: replace vinyl/modern/textured/contempo
·
back to Silverleafwallpaper
·
Fix contact forms: send George X-Send-Approval token when co b6dc797 →