01f8974314
CI / Architecture Guardrails (pull_request) Successful in 2m59s
CI / Typecheck (pull_request) Successful in 6m41s
CI / Lint (pull_request) Successful in 4m18s
CI / Assistant Split Regression (pull_request) Successful in 5m6s
CI / Unit Tests (pull_request) Successful in 7m21s
CI / Build (pull_request) Successful in 5m21s
CI / Fresh-Linux Docker Deploy (pull_request) Failing after 38s
CI / E2E Tests (pull_request) Successful in 3m28s
CI / Release Images (pull_request) Has been skipped
- docker-compose.yml / .prod.yml / .ci.yml: project names, POSTGRES_DB/USER, pg_isready, DATABASE_URL, volume names (nexus_pgdata, nexus_prod_*) - .github/workflows/ci.yml: POSTGRES_PASSWORD, pg_isready, psql credentials, GRANT statements, POSTGRES_PASSWORD=nexus_dev for Docker Deploy job - scripts/db-target-guard.mjs: expectedDatabase default, NEXUS_EXPECTED_DB_NAME - scripts/prisma-with-env.mjs, e2e/test-server.mjs: env-var rename - packages/db/src/safe-destructive-env.ts + reset-dispo-import.ts: DB name set - packages/db/src/destructive-db-guard.ts: PROTECTED_DATABASE_NAMES → "nexus" - packages/db/src/destructive-db-guard.test.ts: all fixture DB names + comments - .env.example, tooling/deploy/deploy.env.example: DATABASE_URL, image refs - packages/api: Redis channel/key prefixes (rbac-invalidate, sse, ratelimit), logger service name, app-base-url log prefix - E2E: DB container names, localStorage/sessionStorage keys, email domains - scripts: architecture-guardrails filter, export/import-dev-seed defaults, harden-postgres defaults, start.sh pg_isready, worktree-hygiene fixture - tooling/migrate/rename-to-nexus.sh: new maintenance-window cutover script Only intentional capakraken survivor: anonymization.ts DEFAULT_ANONYMIZATION_SEED (functional cryptographic constant — changing it would invalidate stored aliases). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
54 lines
1.6 KiB
Bash
Executable File
54 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
APP_PORT="${APP_PORT:-3100}"
|
|
APP_CONTAINER="${APP_CONTAINER:-$(docker compose --profile full ps -q app 2>/dev/null | head -1)}"
|
|
|
|
echo "Starting CapaKraken..."
|
|
|
|
# 1. Start Docker services
|
|
echo " Starting PostgreSQL + Redis..."
|
|
docker compose up -d postgres redis
|
|
sleep 2
|
|
|
|
# 2. Wait for PostgreSQL to be healthy
|
|
echo " Waiting for PostgreSQL..."
|
|
for i in {1..30}; do
|
|
if docker compose exec -T postgres pg_isready -U nexus -d nexus -q 2>/dev/null; then
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
# 3. Start the web app in Docker for a stable lifecycle
|
|
echo " Starting app container on port ${APP_PORT}..."
|
|
docker compose --profile full up -d app
|
|
|
|
# Resolve container name after start (docker compose generates it from project dir + service)
|
|
APP_CONTAINER="$(docker compose --profile full ps -q app 2>/dev/null | head -1)"
|
|
|
|
# 4. Wait for server to be ready
|
|
# Allow up to 90s: prisma generate + migrate deploy + next dev compilation
|
|
echo " Waiting for server (up to 90s)..."
|
|
for i in {1..90}; do
|
|
if curl -sf "http://localhost:${APP_PORT}/api/health" > /dev/null 2>&1; then
|
|
echo ""
|
|
echo "CapaKraken is running!"
|
|
curl -s "http://localhost:${APP_PORT}/api/ready" | python3 -m json.tool 2>/dev/null || curl -s "http://localhost:${APP_PORT}/api/ready"
|
|
echo ""
|
|
echo " URL: http://localhost:${APP_PORT}"
|
|
echo " Logs: docker logs -f ${APP_CONTAINER}"
|
|
exit 0
|
|
fi
|
|
# Print progress every 10s
|
|
if (( i % 10 == 0 )); then
|
|
echo " Still waiting... (${i}s)"
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
echo "ERROR: Server failed to start within 90 seconds"
|
|
echo "Check logs: docker logs --tail 100 ${APP_CONTAINER}"
|
|
exit 1
|