feat: Sprint 10 - Architecture docs, CI/CD, operational scripts
Some checks failed
CI / lint-and-test (push) Has been cancelled
Some checks failed
CI / lint-and-test (push) Has been cancelled
Phase 1 - Architecture Documentation: - Add Architecture section with Mermaid flowchart to README - Create docs/DATABASE_SCHEMA.md with full ERD Phase 2 - CI/CD: - Add CI badge to README - Create .gitea/workflows/ci.yml for linting and tests - Create .gitea/workflows/deploy-staging.yml - Create .gitea/workflows/deploy-production.yml Phase 3 - Operational Scripts: - Create scripts/logs.sh for docker compose log following - Create scripts/run-detached.sh with health check loop - Create scripts/etl/toronto.sh for Toronto data pipeline - Add Makefile targets: logs, run-detached, etl-toronto Phase 4 - Runbooks: - Create docs/runbooks/adding-dashboard.md - Create docs/runbooks/deployment.md Phase 5 - Hygiene: - Create MIT LICENSE file Phase 6 - Production: - Add live demo link to README (leodata.science) Closes #78, #79, #80, #81, #82, #83, #84, #85, #86, #87, #88, #89, #91 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
38
scripts/run-detached.sh
Executable file
38
scripts/run-detached.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/run-detached.sh - Start containers and wait for health
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/run-detached.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TIMEOUT=60
|
||||
INTERVAL=5
|
||||
|
||||
echo "Starting containers in detached mode..."
|
||||
docker compose up -d
|
||||
|
||||
echo "Waiting for services to become healthy..."
|
||||
elapsed=0
|
||||
|
||||
while [ $elapsed -lt $TIMEOUT ]; do
|
||||
# Check if postgres is ready
|
||||
if docker compose exec -T postgres pg_isready -U portfolio > /dev/null 2>&1; then
|
||||
echo "PostgreSQL is ready!"
|
||||
|
||||
# Check if app health endpoint responds (if running)
|
||||
if curl -sf http://localhost:8050/health > /dev/null 2>&1; then
|
||||
echo "Application health check passed!"
|
||||
echo "All services are healthy."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Waiting... ($elapsed/$TIMEOUT seconds)"
|
||||
sleep $INTERVAL
|
||||
elapsed=$((elapsed + INTERVAL))
|
||||
done
|
||||
|
||||
echo "ERROR: Health check timed out after $TIMEOUT seconds"
|
||||
docker compose ps
|
||||
exit 1
|
||||
Reference in New Issue
Block a user