From f6824019c81fe4b535495efee4f309ed7c38b9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lohrer?= Date: Tue, 28 Apr 2026 08:55:53 +0200 Subject: [PATCH] feat(deploy): snapshot vor svelte-build im deploy-skript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Damit DEPLOY_TARGET=svelte/staging/prod immer mit aktuellem snapshot/output baut. Ohne diesen step wuerde ein veralteter snapshot ins HTML wandern, frische posts oder uebersetzungen saessen erst beim naechsten deploy drin. Schlaegt der snapshot fehl (relays down, env fehlt), bricht das skript ab — bewusst hard-fail, damit kein verfaelschter build hochgeladen wird. Live-verifiziert auf https://svelte.joerg-lohrer.de/bibel-selfies/: - HTTP 200, og-tags + hreflang + json-ld korrekt - __SITE_URL__-substitution greift sauber - , og:title, json-ld stimmen mit snapshot ueberein Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --- scripts/deploy-svelte.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/deploy-svelte.sh b/scripts/deploy-svelte.sh index 52fe61f..a00db9d 100755 --- a/scripts/deploy-svelte.sh +++ b/scripts/deploy-svelte.sh @@ -76,6 +76,18 @@ for pair in "$FTP_HOST_KEY:$FTP_HOST" "$FTP_USER_KEY:$FTP_USER" \ done BUILD_DIR="$ROOT/app/build" +SNAPSHOT_DIR="$ROOT/snapshot/output" + +echo "Ziehe Snapshot von Relays …" +(cd "$ROOT/snapshot" && deno task snapshot) || { + echo "FEHLER: Snapshot fehlgeschlagen. 'cd snapshot && deno task snapshot' manuell ausführen zum Debuggen." >&2 + exit 1 +} + +if [ ! -f "$SNAPSHOT_DIR/index.json" ]; then + echo "FEHLER: $SNAPSHOT_DIR/index.json fehlt nach snapshot." >&2 + exit 1 +fi echo "Baue SvelteKit …" (cd "$ROOT/app" && npm run build >/dev/null 2>&1) || {