larpaso-website/publish-content-to-live.sh
Pascal Scholz f75296da44 Add sync/publish scripts for content changes made via Claude Code
Lets content edits pushed through Git reach the live admin-content
volume (and vice versa) without silently overwriting whatever was
changed through the admin editor UI in the meantime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 22:49:01 +02:00

20 lines
803 B
Bash

#!/bin/bash
# Spielt content/site.json + theme.json aus dem (frisch gepullten) Git-Stand
# zurück ins Admin-Volume und stößt denselben Build/Publish an, den auch der
# "Speichern & veröffentlichen"-Knopf im Editor auslöst. Auf dem Server
# ausführen, aus ~/stack, NACHDEM in ~/sites/larpaso-website ein
# `git pull` gemacht wurde:
# ./publish-content-to-live.sh ~/sites/larpaso-website
set -euo pipefail
REPO="${1:-$HOME/sites/larpaso-website}"
docker compose cp "$REPO/content/site.json" admin:/app/content/site.json
docker compose cp "$REPO/content/theme.json" admin:/app/content/theme.json
docker compose exec admin node -e "
require('/app/admin/lib/build.js').runBuild().then((r) => {
console.log(r.ok ? 'Veröffentlicht.' : ('Fehler: ' + r.error));
process.exit(r.ok ? 0 : 1);
});
"