seed script

This commit is contained in:
javad committed 2026-09-10 16:39:02 +03:30
1 parent fa9d154db9
commit 08c30aa47f
15 files changed
+496 -17

No files matched your search

+17 -2
View File
@@ -38,8 +38,23 @@ if [ "${RUN_STARTUP_TASKS:-0}" = "1" ]; then
echo "==> Applying database migrations..."
python manage.py migrate --noinput
echo "==> Bootstrapping required application data..."
python manage.py bootstrap
seed_dir="${PRODUCTION_SEED_DIR:-/app/production-seed}"
seed_available=0
if [ -f "$seed_dir/manifest.json" ]; then
echo "==> Importing production seed (idempotent)..."
python manage.py import_production_seed "$seed_dir"
seed_available=1
elif [ "${REQUIRE_PRODUCTION_SEED:-1}" = "1" ]; then
echo "ERROR: Required production seed is missing from $seed_dir" >&2
exit 1
fi
if [ "$seed_available" = "0" ]; then
echo "==> Bootstrapping required application data..."
python manage.py bootstrap
else
echo "==> Production seed is authoritative; skipping bootstrap mutations."
fi
echo "==> Collecting static files..."
python manage.py collectstatic --noinput