[object Object]

← back to Designer Wallcoverings

vcc: add deploy-programs-hub.sh — drift-safe Kamatera deploy for the /programs hub (TK-11765)

95aca9763b9d55d89fcdf836d02d108fd2d5bc01 · 2026-09-15 11:55:40 -0700 · Steve

Backup live server.js, scp server.js + public/programs.html, node --check, pm2 restart, verify route+page+online, print rollback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jc3tC98ExHfU5P3zptiXZK

Files touched

Diff

commit 95aca9763b9d55d89fcdf836d02d108fd2d5bc01
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Sep 15 11:55:40 2026 -0700

    vcc: add deploy-programs-hub.sh — drift-safe Kamatera deploy for the /programs hub (TK-11765)
    
    Backup live server.js, scp server.js + public/programs.html, node --check, pm2 restart, verify route+page+online, print rollback.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Jc3tC98ExHfU5P3zptiXZK
---
 .../vendor-command-center/deploy-programs-hub.sh   | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/DW-Agents/vendor-command-center/deploy-programs-hub.sh b/DW-Agents/vendor-command-center/deploy-programs-hub.sh
new file mode 100644
index 00000000..8554dd09
--- /dev/null
+++ b/DW-Agents/vendor-command-center/deploy-programs-hub.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Drift-safe deploy of the "All DW Programs" hub (TK-11765) to Kamatera vendor-command-center.
+# Syncs the modified server.js (adds gated /api/programs + /programs) and the NEW public/programs.html,
+# backs up the live server.js, node --checks, restarts pm2, and verifies the route is present + gated.
+set -euo pipefail
+SRC="$HOME/Projects/Designer-Wallcoverings/DW-Agents/vendor-command-center"
+DST="/root/DW-Agents/vendor-command-center"
+TS=$(date +%Y%m%d-%H%M%S)
+
+echo "1/5 backup live server.js -> .bak-$TS"
+ssh my-server "cp $DST/server.js $DST/server.js.bak-$TS"
+
+echo "2/5 ensure public/ exists on prod"
+ssh my-server "mkdir -p $DST/public"
+
+echo "3/5 sync the two files (server.js modified, programs.html new)"
+scp "$SRC/server.js"            my-server:"$DST/server.js"
+scp "$SRC/public/programs.html" my-server:"$DST/public/programs.html"
+
+echo "4/5 node --check + pm2 restart"
+ssh my-server "node --check $DST/server.js && pm2 restart vendor-command-center --update-env"
+
+echo "5/5 verify route present + gated (behind requireAuth) + page file landed + agent online"
+ssh my-server "grep -c \"app.get('/api/programs'\" $DST/server.js; test -f $DST/public/programs.html && echo 'programs.html: present'; pm2 list | grep vendor-command-center"
+
+echo
+echo "DONE. Rollback if needed:"
+echo "  ssh my-server \"cp $DST/server.js.bak-$TS $DST/server.js && rm -f $DST/public/programs.html && pm2 restart vendor-command-center\""

← 995a82ea harden: fail loud on bare run across dry-by-default scripts  ·  back to Designer Wallcoverings  ·  chore: bump pj-onboard-20260901 submodule → f370c12 (TK-1150 fda471ce →