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>
20 lines
803 B
Bash
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);
|
|
});
|
|
"
|