likwid/scripts/prepare-production.ps1

38 lines
1.5 KiB
PowerShell
Raw Normal View History

# Prepare Production Build Script (Windows PowerShell)
# Creates a production-ready backend without demo seed data
$ErrorActionPreference = "Stop"
Write-Host "=== Preparing Production Build ===" -ForegroundColor Cyan
$projectRoot = "$PSScriptRoot\.."
$backendDir = "$projectRoot\backend"
$migrationsDir = "$backendDir\migrations"
$demoMigration = "$migrationsDir\20260127150000_demo_seed_data.sql"
# Check if demo migration exists
if (Test-Path $demoMigration) {
Write-Host "`nDemo seed migration found. For production:" -ForegroundColor Yellow
Write-Host " 1. This file should be EXCLUDED from production deployments"
Write-Host " 2. It contains test users and sample data"
Write-Host ""
$action = Read-Host "Remove demo migration for production build? (y/N)"
if ($action -eq "y" -or $action -eq "Y") {
# Backup first
$backupPath = "$demoMigration.backup"
Copy-Item $demoMigration $backupPath
Remove-Item $demoMigration
Write-Host "Demo migration removed (backup at $backupPath)" -ForegroundColor Green
} else {
Write-Host "Keeping demo migration. Remember to remove for production!" -ForegroundColor Yellow
}
} else {
Write-Host "Demo migration not found - already production ready" -ForegroundColor Green
}
Write-Host "`n=== Production Preparation Complete ===" -ForegroundColor Green
Write-Host "`nNext steps:"
Write-Host " 1. Configure compose/.env.production"
Write-Host " 2. Run: podman-compose -f compose/production.yml up -d"