fix(seed): add required id to seed entries + make seed non-fatal
ci/woodpecker/push/container Pipeline was canceled

emdash seed validates that every content entry has an id (validate.ts),
but seed/seed.json entries only had slug — so seed aborted with 'id is
required' and, under set -e, crash-looped the pod (502). Set id=slug for
all 42 entries (conflict-detection keys off slug, so id is just the
seed-local ref key). Also move the seed step out from under set -e: a bad
content seed should log loudly but not take the whole site down (init
migrations stay fatal).
This commit is contained in:
Oleks
2026-06-14 14:06:41 +03:00
parent 96c220825f
commit 87eb6a0f84
2 changed files with 1048 additions and 571 deletions
+1038 -570
View File
File diff suppressed because it is too large Load Diff
+10 -1
View File
@@ -15,7 +15,16 @@ mkdir -p /app/state/uploads
# upgrades against an existing PVC and never recover a partial first-run init.)
echo "[entrypoint] running emdash init (applies pending migrations)"
node_modules/.bin/emdash init
# Seed is best-effort: unlike migrations, a content-seed failure (e.g. a bad
# seed.json entry) must NOT crash-loop the whole site, so it is NOT under the
# `set -e` abort. We still surface a non-zero rc loudly in the logs rather than
# swallowing it silently.
echo "[entrypoint] running emdash seed (applies seed/seed.json, onConflict=skip)"
node_modules/.bin/emdash seed
if node_modules/.bin/emdash seed; then
echo "[entrypoint] emdash seed ok"
else
echo "[entrypoint] WARNING: emdash seed failed (rc=$?) — serving without full seed" >&2
fi
exec "$@"