Files
member-console/test/seed-stack.sh
Christian Galo 535810c2ef Seed FedWiki fixtures from Keycloak
Add a fedwiki-render compose service and render.sh to resolve real
Keycloak user UUIDs and render .tpl templates into testdata on compose
up.
Convert hardcoded FedWiki testdata into templates, add seed-stack.sh
helper,
and update compose/env and .gitignore to run seeding before starting
fedwiki.
2026-04-29 15:55:40 -05:00

29 lines
740 B
Bash
Executable File

#!/usr/bin/env bash
# Populates the running test stack with realm users + FedWiki identity
# fixtures. Run after `docker compose up -d` brings the stack up.
#
# Idempotent: seed-keycloak.sh is no-op when entities already exist;
# render.sh re-templates against the current realm state. Re-run any
# time the realm is reseeded or KC volume is wiped.
set -euo pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
TEST_DIR="${REPO_ROOT}/test"
cd "$TEST_DIR"
echo "==> Seeding Keycloak realm..."
./seed/keycloak/seed-keycloak.sh
echo
echo "==> Rendering FedWiki identity fixtures..."
./seed/fedwiki/render.sh
echo
echo "==> Restarting fedwiki to pick up rendered config.json..."
docker compose restart fedwiki
echo
echo "Stack seeded."