← back to Designer Wallcoverings
Add gated publish-5.1-to-live script (Steve runs to swap live theme)
fff4983cbfbf115e1fd7cf401cfdeaebf712fa73 · 2026-06-23 16:50:49 -0700 · Steve
Files touched
A shopify/publish-5.1-to-live.sh
Diff
commit fff4983cbfbf115e1fd7cf401cfdeaebf712fa73
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Jun 23 16:50:49 2026 -0700
Add gated publish-5.1-to-live script (Steve runs to swap live theme)
---
shopify/publish-5.1-to-live.sh | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/shopify/publish-5.1-to-live.sh b/shopify/publish-5.1-to-live.sh
new file mode 100755
index 00000000..f91be43c
--- /dev/null
+++ b/shopify/publish-5.1-to-live.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+# PUBLISH "Steves Version 5.1" (143933472819) to LIVE on the DW production store.
+# Ships together: mobile 2-per-row collection grid + mobile infinite scroll +
+# the You-May-Also-Like fix (3-up+text mobile / 4-up image-only desktop).
+#
+# Records the current live theme as the rollback target, swaps role=main to 5.1,
+# and verifies. Token read from secrets, never printed. Reversible — re-publish
+# the printed ROLLBACK id to revert instantly.
+#
+# Run it yourself (the agent's auto-mode blocks live-theme publishes):
+# ! bash ~/Projects/Designer-Wallcoverings/shopify/publish-5.1-to-live.sh
+set -euo pipefail
+cd "$(dirname "$0")"
+STORE="designer-laboratory-sandbox.myshopify.com"; API="2024-10"
+NEW_LIVE="143933472819" # Steves Version 5.1
+TOK="$(grep -hE '^SHOPIFY_THEME_TOKEN=' "$HOME/Projects/secrets-manager/.env" | head -1 | cut -d= -f2- | tr -d '"'"'"' ')"
+[ -z "$TOK" ] && { echo "No SHOPIFY_THEME_TOKEN in secrets."; exit 1; }
+echo "token …${TOK: -4}"
+python3 - "$STORE" "$API" "$TOK" "$NEW_LIVE" <<'PY'
+import sys, json, urllib.request
+store, api, tok, newid = sys.argv[1:5]
+H={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"}
+def req(u,m="GET",b=None):
+ r=urllib.request.Request(u,headers=H,method=m,data=json.dumps(b).encode() if b else None)
+ return json.load(urllib.request.urlopen(r))
+themes=req(f"https://{store}/admin/api/{api}/themes.json")["themes"]
+cur=next(t for t in themes if t["role"]=="main")
+print(f'ROLLBACK TARGET (current live): {cur["id"]} "{cur["name"]}"')
+tgt=next(t for t in themes if str(t["id"])==newid)
+print(f'PUBLISHING: {tgt["id"]} "{tgt["name"]}" (was role={tgt["role"]})')
+res=req(f"https://{store}/admin/api/{api}/themes/{newid}.json","PUT",{"theme":{"id":int(newid),"role":"main"}})
+print("PUT role ->", res["theme"]["role"])
+t2=req(f"https://{store}/admin/api/{api}/themes.json")["themes"]
+nm=next(t for t in t2 if t["role"]=="main")
+print(f'NOW LIVE: {nm["id"]} "{nm["name"]}"')
+print("PUBLISH_OK" if str(nm["id"])==newid else "PUBLISH_MISMATCH")
+print(f'ROLLBACK if needed: change NEW_LIVE to {cur["id"]} and re-run, or publish it from Shopify admin.')
+PY
\ No newline at end of file
← b91b417b Env-ify 3 DW vendor-command-center files: remove leaked Gemi
·
back to Designer Wallcoverings
·
auto-save: 2026-06-23T16:53:06 (9 files) — shopify/scripts/c 407a1762 →