chore(backend): add explicit test data seed command
All checks were successful
deploy-socialize / image (push) Successful in 53s
deploy-socialize / deploy (push) Successful in 21s

This commit is contained in:
2026-05-07 13:43:53 -04:00
parent 918136aae2
commit 6e417312f9
9 changed files with 74 additions and 47 deletions

19
scripts/seed-testdata.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
cd "$REPO_ROOT"
export ASPNETCORE_ENVIRONMENT="${ASPNETCORE_ENVIRONMENT:-Development}"
if [[ "$ASPNETCORE_ENVIRONMENT" == "Production" && "${CONFIRM_PRODUCTION_SEED:-}" != "true" ]]; then
echo "Refusing to seed test data in Production without CONFIRM_PRODUCTION_SEED=true." >&2
exit 2
fi
dotnet run \
--no-launch-profile \
--project backend/src/Socialize.Api/Socialize.Api.csproj \
-- seed-testdata "$@"