-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (56 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
72 lines (56 loc) · 1.81 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PHONY: dev build test clean migrate seed deploy help
# Default target
help:
@echo "AgentCostControl - Available commands:"
@echo " make dev - Start development environment"
@echo " make build - Build Docker images"
@echo " make test - Run all tests"
@echo " make migrate - Run database migrations"
@echo " make seed - Seed database with test data"
@echo " make clean - Clean up generated files"
@echo " make deploy - Deploy to production"
# Development
dev:
docker-compose up -d
@echo "Development environment started!"
@echo "Dashboard: http://localhost:3000"
@echo "API: http://localhost:8000"
@echo "API Docs: http://localhost:8000/docs"
dev-down:
docker-compose down
# Build
build:
docker-compose build
# Testing
test:
cd proxy && uv run pytest -v
test-coverage:
cd proxy && uv run pytest --cov=app --cov-report=html
# Database
migrate:
cd proxy && uv run alembic upgrade head
migrate-down:
cd proxy && uv run alembic downgrade -1
migration:
@read -p "Enter migration message: " msg; \
cd proxy && uv run alembic revision --autogenerate -m "$$msg"
seed:
cd proxy && uv run python scripts/seed_pricing.py
# Clean
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "node_modules" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "dist" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".venv" -exec rm -rf {} + 2>/dev/null || true
# Production
deploy:
docker-compose -f docker-compose.prod.yml up -d --build
deploy-down:
docker-compose -f docker-compose.prod.yml down
# Install dependencies
install-backend:
cd proxy && uv sync
install-frontend:
cd dashboard && npm install
install: install-backend install-frontend