← back to Dw Fleet Refresh
chore: add weekly driver + VERSION v1.0.0 (session close)
df268b0e1c30888ef53d189daa2b5b485d190352 · 2026-08-12 10:58:02 -0700 · steve@designerwallcoverings.com
Files touched
Diff
commit df268b0e1c30888ef53d189daa2b5b485d190352
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Wed Aug 12 10:58:02 2026 -0700
chore: add weekly driver + VERSION v1.0.0 (session close)
---
VERSION | 1 +
run-weekly.sh | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..3eefcb9
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.0.0
diff --git a/run-weekly.sh b/run-weekly.sh
new file mode 100755
index 0000000..cd20d19
--- /dev/null
+++ b/run-weekly.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Weekly driver (Mac2 launchd). Builds snapshot + refreshes+deploys all sister
+# sites on Kamatera, then emails a summary via George + posts a CNCP card.
+set -o pipefail
+TS=$(date '+%Y-%m-%d %H:%M %Z')
+LOGDIR="$HOME/Projects/dw-fleet-refresh/runs"; mkdir -p "$LOGDIR"
+OUT="$LOGDIR/run-$(date +%Y%m%d-%H%M%S).json"
+TOKEN=$(grep -E '^SHOPIFY_ADMIN_TOKEN=' "$HOME/Projects/secrets-manager/.env" | head -1 | cut -d= -f2- | tr -d '"'"'"' ')
+ssh -o ConnectTimeout=12 root@45.61.58.125 "SHOPIFY_ADMIN_TOKEN='$TOKEN' node /tmp/fleet-weekly-refresh.js --all --deploy" > "$OUT" 2> "$LOGDIR/run-$(date +%Y%m%d-%H%M%S).stderr"
+cp "$OUT" "$LOGDIR/last-run.json"
+# summarize
+SUMMARY=$(node -e '
+const d=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));
+const L=d.ledger||[];
+const deployed=L.filter(x=>x.deployed).length;
+const failed=L.filter(x=>x.gate&&x.gate!=="PASS");
+const totalAdded=L.reduce((s,x)=>s+(x.added||0),0), totalDropped=L.reduce((s,x)=>s+(x.dropped||0),0), totalRefresh=L.reduce((s,x)=>s+(x.refreshed||0),0);
+let s=`snapshot=${d.snapshot} live products | sites=${d.sites} | deployed=${deployed} | refreshedURLs=${totalRefresh} droppedDead=${totalDropped} addedNew=${totalAdded}\n`;
+if(failed.length){ s+=`\nGATE-BLOCKED (NOT deployed) ${failed.length}:\n`+failed.map(x=>` ${x.site}: ${x.gate} (prior=${x.prior} final=${x.final})`).join("\n"); }
+else s+="\nAll sites passed gates.";
+console.log(s);
+' "$OUT")
+echo "$SUMMARY"
+# email via George
+BODY="DW weekly fleet refresh — $TS\n\n$SUMMARY\n\nLedger: $OUT"
+curl -s -X POST http://127.0.0.1:9850/api/send \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Basic $(printf 'admin:%s' "${GEORGE_BASIC_AUTH_PASS:-}" | base64)" \
+ -d "$(node -e 'console.log(JSON.stringify({to:"steve@designerwallcoverings.com",subject:"DW weekly fleet refresh",text:process.argv[1]}))' "$BODY")" \
+ -o /dev/null -w "george email: HTTP %{http_code}\n" 2>/dev/null || echo "(george email skipped)"
+# CNCP card
+curl -s -X POST http://127.0.0.1:3333/api/parking-lot -H 'Content-Type: application/json' \
+ -d "$(node -e 'console.log(JSON.stringify({title:"Weekly fleet refresh ran",note:process.argv[1]}))' "$SUMMARY")" \
+ -o /dev/null -w "cncp card: HTTP %{http_code}\n" 2>/dev/null || echo "(cncp skipped)"
← e2a9503 dw-fleet-weekly-refresh engine: snapshot-driven per-site ref
·
back to Dw Fleet Refresh
·
auto-data-snapshot: 2026-08-16T04:20:17 (4 data files) — run aee7d36 →