-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (39 loc) · 1.39 KB
/
Makefile
File metadata and controls
46 lines (39 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: dev migrate reset-db seed-demo seed-m1-model test lint
dev:
@echo "Starting infrastructure services..."
docker compose -f infra/docker-compose.dev.yml up -d
@echo "Waiting for services to be healthy..."
@sleep 5
@echo ""
@echo "=== Running Services ==="
@echo " PostgreSQL (TimescaleDB+PostGIS): localhost:5432"
@echo " MinIO API: localhost:9000"
@echo " MinIO Console: localhost:9001"
@echo " FastAPI (Swagger UI): localhost:$(or $(API_PORT),8000)/docs"
@echo ""
@echo "Starting FastAPI in reload mode..."
API_PORT=$(or $(API_PORT),8000) python -m uvicorn apps.api.main:app --host 0.0.0.0 --port $(or $(API_PORT),8000) --reload
migrate:
@echo "Running database migrations..."
python -m packages.common.migrate
@echo "Migration complete."
reset-db:
@echo "Resetting database..."
PGPASSWORD=nhms_dev psql -h localhost -U nhms -d postgres -c "DROP DATABASE IF EXISTS nhms;" || true
PGPASSWORD=nhms_dev psql -h localhost -U nhms -d postgres -c "CREATE DATABASE nhms;"
$(MAKE) migrate
$(MAKE) seed-demo
@echo "Database reset complete."
seed-demo:
@echo "Seeding demo data..."
python -m db.seeds.seed_demo
@echo "Seed complete."
seed-m1-model:
@echo "Seeding M1 model registry assets..."
python -m db.seeds.seed_m1_model
@echo "M1 model seed complete."
test:
python -m pytest tests/ -v
lint:
ruff check .
@echo "Lint passed."