-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
154 lines (124 loc) · 4.18 KB
/
Makefile
File metadata and controls
154 lines (124 loc) · 4.18 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.PHONY: up down build logs clean stop gate dev test test-seq test-no-open test-report test-clean lint typecheck docs-check help run migrate-create migrate-up migrate-down migrate-history migrate-current prod-init prod-up prod-down prod-logs install-hooks
# Default target
help:
@echo "AgentGate - AI Agent Middleware"
@echo ""
@echo "Usage:"
@echo " make up Start all services (delegates to ./run demo)"
@echo " make down Stop all services (delegates to ./run stop)"
@echo " make build Rebuild containers"
@echo " make logs View logs"
@echo " make clean Full reset (delegates to ./run clean --wipe-data)"
@echo " make stop Stop all services and preserve volumes"
@echo " make gate Chronological quality gate (infra->lint->test)"
@echo " make dev Start development servers (delegates to ./run dev)"
@echo " make test Run tests (delegates to ./run test)"
@echo " make test-seq Run tests (sequential)"
@echo " make test-no-open Run tests without opening report"
@echo " make test-report View Allure test report"
@echo " make test-clean Clear all Allure results and history"
@echo " make lint Run lint checks (delegates to ./run lint)"
@echo " make typecheck Run mypy type checks (ea_agentgate package)"
@echo " make docs-check Run strict docs governance checks"
@echo " make run Interactive CLI (canonical entry: ./run)"
@echo " make install-hooks Install git pre-commit hook (secret detection)"
@echo ""
@echo "Database Migrations:"
@echo " make migrate-create Create new migration (MESSAGE='description')"
@echo " make migrate-up Apply all pending migrations"
@echo " make migrate-down Rollback last migration"
@echo " make migrate-history View migration history"
@echo " make migrate-current Show current migration version"
@echo ""
@echo "Production Deployment:"
@echo " make prod-init Initialize production environment"
@echo " make prod-up Start production services"
@echo " make prod-down Stop production services"
@echo " make prod-logs View production logs"
@echo ""
# Docker commands
up:
./run demo
down:
./run stop
stop:
./run stop
build:
docker-compose build --no-cache
logs:
./run logs
clean:
./run clean --wipe-data
gate:
./run gate
# Development (no Docker)
dev:
./run dev
# Testing
test:
./run test
test-seq:
./run test --no-parallel
test-no-open:
./run test --no-open
test-report:
./run test --report
test-clean:
./run test --clean
# Linting
lint:
./run lint
# Type checking
typecheck:
python3 -m mypy ea_agentgate
# Documentation governance checks
docs-check:
./run docs-check
# Interactive CLI
run:
./run $(filter-out $@,$(MAKECMDGOALS))
# Red-team LLM-assisted testing
redteam-llm:
python3 -c "from server.mcp.ai_redteam import RedTeamGenerator; \
g = RedTeamGenerator(); \
r = g.generate_and_test(category='all', count=50); \
print(r.model_dump_json(indent=2))"
# Install dependencies
install: install-hooks
uv pip install -e ".[dev,server]"
cd dashboard && npm install
# Install git hooks (secret detection pre-commit)
install-hooks:
@cp scripts/pre-commit .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Installed pre-commit hook (secret detection)"
# Database migrations
migrate-create:
@if [ -z "$(MESSAGE)" ]; then \
echo "Error: MESSAGE is required. Usage: make migrate-create MESSAGE='your description'"; \
exit 1; \
fi
alembic revision --autogenerate -m "$(MESSAGE)"
migrate-up:
alembic upgrade head
migrate-down:
alembic downgrade -1
migrate-history:
alembic history --verbose
migrate-current:
alembic current
# Production deployment
prod-init:
./scripts/init_production.sh
prod-up:
docker-compose -f docker-compose.production.yml up -d
@echo ""
@echo "AgentGate Production is running!"
@echo " Dashboard: http://localhost:3000"
@echo " API Docs: http://localhost:3000/docs/api-reference"
@echo " Metrics: http://localhost:9090/metrics"
@echo ""
prod-down:
docker-compose -f docker-compose.production.yml down
prod-logs:
docker-compose -f docker-compose.production.yml logs -f