Initial commit: MOPC platform with Docker deployment setup
Full Next.js 15 platform with tRPC, Prisma, PostgreSQL, NextAuth. Includes production Dockerfile (multi-stage, port 7600), docker-compose with registry-based image pull, Gitea Actions CI workflow, nginx config for portal.monaco-opc.com, deployment scripts, and DEPLOYMENT.md guide. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
52
scripts/seed.sh
Normal file
52
scripts/seed.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# MOPC Platform - One-Time Database Seed
|
||||
# =============================================================================
|
||||
# Usage: ./scripts/seed.sh
|
||||
# Run this ONCE after the first deployment to populate the database with:
|
||||
# - Super admin user
|
||||
# - System settings
|
||||
# - Program & Round 1 configuration
|
||||
# - Evaluation form
|
||||
# - Candidature data from CSV
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
DOCKER_DIR="$PROJECT_DIR/docker"
|
||||
|
||||
echo "============================================"
|
||||
echo " MOPC Platform - Database Seed"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
echo "This will seed the database with:"
|
||||
echo " - Admin user & system settings"
|
||||
echo " - Program, Round 1, evaluation form"
|
||||
echo " - Candidature data from CSV"
|
||||
echo ""
|
||||
read -p "Continue? (y/N) " -n 1 -r
|
||||
echo ""
|
||||
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Aborted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "==> Running base seed (admin, settings, program, round, eval form)..."
|
||||
cd "$DOCKER_DIR"
|
||||
docker compose exec app npx tsx prisma/seed.ts
|
||||
|
||||
echo ""
|
||||
echo "==> Running candidatures import from CSV..."
|
||||
docker compose exec app npx tsx prisma/seed-candidatures.ts
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
echo " Seed complete!"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
echo " Admin login: matt.ciaccio@gmail.com"
|
||||
echo " (Use magic link authentication)"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user