t4: consolidate seed scripts, remove demo modes, standardize passwords
api-ci-deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-05-29 19:51:32 +01:00
parent abc90fa1b6
commit e66c8ec291
10 changed files with 192 additions and 995 deletions
+28 -56
View File
@@ -2,7 +2,7 @@
# ClassroomCopilot Startup Script
# Usage: ./start.sh [start_mode]
# start_mode options: infra, demo-school, demo-users, gais-data, full, dev, prod
# start_mode options: infra, seed, seed-test, gais-data, full, dev, prod
set -e
@@ -14,10 +14,10 @@ show_help() {
echo ""
echo "Start modes:"
echo " infra - Setup infrastructure (Neo4j schema, calendar, Supabase buckets)"
echo " demo-school - Create demo school (KevlarAI)"
echo " demo-users - Create demo users"
echo " seed - Seed canonical full environment (20 school users)"
echo " seed-test - Seed lightweight test environment (9 school users)"
echo " gais-data - Import GAIS data (Edubase, etc.)"
echo " full - Run full initialization (infra → demo-school → demo-users → gais-data)"
echo " full - Run full initialization (infra → seed)"
echo " nuke - 💥 NUKE Redis - Clear all queue data for fresh start"
echo " dev - Run development server with auto-reload"
echo " prod - Run production server (for Docker/containerized deployment)"
@@ -25,8 +25,8 @@ show_help() {
echo "Examples:"
echo " ./start.sh # Run in dev mode (default)"
echo " ./start.sh infra # Setup infrastructure"
echo " ./start.sh demo-school # Create demo school"
echo " ./start.sh demo-users # Create demo users"
echo " ./start.sh seed # Seed canonical full environment"
echo " ./start.sh seed-test # Seed lightweight test environment"
echo " ./start.sh gais-data # Import GAIS data"
echo " ./start.sh full # Run full initialization"
echo " ./start.sh full --yes # Run full initialization without prompts"
@@ -133,54 +133,32 @@ run_infra() {
fi
}
# Function to run demo school creation
run_demo_school() {
print_status "Running demo school creation mode..."
print_status "This will create the KevlarAI demo school."
# Function to run canonical environment seed
run_seed() {
local mode=${1:-seed}
if [[ "$mode" == "seed-test" ]]; then
print_status "Running lightweight seed-test mode (9 school users)..."
else
print_status "Running canonical seed mode (20 school users)..."
fi
# Check if we should proceed
if [[ "$AUTO_YES" != true ]]; then
read -p "Do you want to continue with demo school creation? (y/N): " -n 1 -r
read -p "Do you want to continue with $mode? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
print_status "Demo school creation cancelled."
print_status "$mode cancelled."
exit 0
fi
fi
print_status "Starting demo school creation process..."
$PYTHON_CMD main.py --mode demo-school
print_status "Starting $mode process..."
$PYTHON_CMD main.py --mode "$mode"
if [ $? -eq 0 ]; then
print_success "Demo school creation completed successfully!"
print_success "$mode completed successfully!"
else
print_error "Demo school creation failed!"
exit 1
fi
}
# Function to run demo users creation
run_demo_users() {
print_status "Running demo users creation mode..."
print_status "This will create demo users for testing."
# Check if we should proceed
if [[ "$AUTO_YES" != true ]]; then
read -p "Do you want to continue with demo users creation? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
print_status "Demo users creation cancelled."
exit 0
fi
fi
print_status "Starting demo users creation process..."
$PYTHON_CMD main.py --mode demo-users
if [ $? -eq 0 ]; then
print_success "Demo users creation completed successfully!"
else
print_error "Demo users creation failed!"
print_error "$mode failed!"
exit 1
fi
}
@@ -274,7 +252,7 @@ except Exception as e:
# Function to run full initialization (all steps in order)
run_full() {
print_status "Running full initialization (infra → demo-school → demo-users → gais-data)..."
print_status "Running full initialization (infra → seed)..."
# Single confirmation for the whole flow
if [[ "$AUTO_YES" != true ]]; then
@@ -289,14 +267,8 @@ run_full() {
# Run infra
run_infra || { print_error "Full init aborted during infra."; exit 1; }
# Run demo school
run_demo_school || { print_error "Full init aborted during demo-school."; exit 1; }
# Run demo users
run_demo_users || { print_error "Full init aborted during demo-users."; exit 1; }
# Run GAIS data import
run_gais_data || { print_error "Full init aborted during gais-data."; exit 1; }
# Run canonical full seed
run_seed seed || { print_error "Full init aborted during seed."; exit 1; }
print_success "Full initialization completed successfully!"
}
@@ -383,11 +355,11 @@ main() {
"infra")
run_infra
;;
"demo-school")
run_demo_school
"seed")
run_seed seed
;;
"demo-users")
run_demo_users
"seed-test")
run_seed seed-test
;;
"gais-data")
run_gais_data
@@ -406,7 +378,7 @@ main() {
;;
*)
print_error "Invalid start mode: $START_MODE"
print_status "Valid modes: infra, demo-school, demo-users, gais-data, nuke, dev, prod"
print_status "Valid modes: infra, seed, seed-test, gais-data, full, nuke, dev, prod"
print_status "Usage: ./start.sh [start_mode]"
print_status "Use './start.sh --help' for more information"
exit 1