861e14503b
## Summary - Fix `isProductionDatabase()` to allow CI database (`euchre_camp_ci`) - Add database schema reset before CI test runs - Create `global.teardown.ts` for cleanup (CI: full reset, dev/prod: selective cleanup) - Add `acceptance-tests` job to PR workflow with CI database - Create `sync-prod-to-dev.js` script for one-way prod→dev sync - Add `just` recipes: `sync-dev`, `test-prod`, `reset-ci-db` - Store credentials in `.credentials` (gitignored) with unique CI user ## Testing Verified against CI database: - Schema reset works - Migrations apply correctly - Test users created successfully - 219 tests pass (slow but working) ## Next Steps - Set `CI_DATABASE_URL` as Gitea repository variable Reviewed-on: #35 Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
48 lines
1.6 KiB
Bash
48 lines
1.6 KiB
Bash
# EuchreCamp Environment Configuration
|
|
# ============================================
|
|
# Copy this file to .env (for local dev) or use
|
|
# .env.development / .env.ci for specific environments
|
|
|
|
# ============================================
|
|
# Database Configuration
|
|
# ============================================
|
|
# IMPORTANT: Use the appropriate DATABASE_URL for your environment:
|
|
#
|
|
# - Development (ephemeral, synced from prod): euchre_camp_dev
|
|
# - CI/Testing (reset before each run): euchre_camp_ci
|
|
# - Production (DO NOT USE FOR TESTS): euchre_camp
|
|
#
|
|
# The .credentials file in the project root contains
|
|
# the actual connection strings - DO NOT commit .credentials
|
|
|
|
DATABASE_PROVIDER=postgresql
|
|
|
|
# ============================================
|
|
# Better Auth Configuration
|
|
# ============================================
|
|
# Generate a new secret with: openssl rand -base64 32
|
|
BETTER_AUTH_SECRET=generate-new-secret-in-production
|
|
|
|
# Base URL - update for production
|
|
BETTER_AUTH_URL=http://localhost:3000
|
|
|
|
# ============================================
|
|
# Application Configuration
|
|
# ============================================
|
|
NODE_ENV=development
|
|
|
|
# Comma-separated list of trusted origins
|
|
TRUSTED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
|
|
|
|
# ============================================
|
|
# Environment-Specific Overrides
|
|
# ============================================
|
|
# For development (.env.development):
|
|
# DATABASE_URL from .credentials (euchre_camp_dev)
|
|
# NODE_ENV=development
|
|
# BETTER_AUTH_URL=http://localhost:3000
|
|
#
|
|
# For CI (.env.ci):
|
|
# DATABASE_URL from .credentials (euchre_camp_ci)
|
|
# NODE_ENV=test
|
|
# BETTER_AUTH_URL=http://localhost:3000 |