-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
175 lines (139 loc) · 5.24 KB
/
Makefile
File metadata and controls
175 lines (139 loc) · 5.24 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.PHONY: help dev-up dev-down dev-logs backend-up backend-down codespaces-up codespaces-down ghcr-up ghcr-down clean rebuild lint test
# Docker Compose configurations
COMPOSE_BASE := docker-compose -f infrastructure/docker-compose.yml
COMPOSE_BACKEND := $(COMPOSE_BASE) -f infrastructure/profiles/backend-only.yml
COMPOSE_CODESPACES := $(COMPOSE_BASE) -f infrastructure/profiles/codespaces.yml
COMPOSE_GHCR := $(COMPOSE_BASE) -f infrastructure/profiles/ghcr.yml
help:
@echo "CodeNavigator (codenav) - Make Targets"
@echo ""
@echo "Docker Compose Stacks:"
@echo " make dev-up - Full development stack (Redis, Memgraph, API, Jupyter, Frontend)"
@echo " make dev-down - Stop development stack"
@echo " make dev-logs - View development logs"
@echo " make dev-status - Show container status"
@echo ""
@echo " make backend-up - Backend only (for local frontend dev with npm)"
@echo " make backend-down - Stop backend services"
@echo ""
@echo " make codespaces-up - Codespaces stack (builds from source, includes frontend)"
@echo " make codespaces-down - Stop Codespaces stack"
@echo ""
@echo " make ghcr-up - GHCR images (pre-built production test)"
@echo " make ghcr-down - Stop GHCR stack"
@echo ""
@echo "Infrastructure:"
@echo " make clean - Remove all containers and volumes"
@echo " make rebuild - Rebuild all images"
@echo " make ps - Show running containers"
@echo ""
@echo "Code Quality:"
@echo " make lint - Run linting checks"
@echo " make format - Format Python code"
@echo ""
@echo "Testing:"
@echo " make test - Run pytest suite"
@echo " make test-coverage - Run pytest with coverage"
@echo ""
# =============================================================================
# Full Development Stack (all services)
# =============================================================================
dev-up:
$(COMPOSE_BASE) up -d
@echo "✅ Full development stack started"
@echo " - Redis: localhost:6379"
@echo " - SSE/MCP: localhost:10101"
@echo " - HTTP API: localhost:10102"
@echo " - Frontend: localhost:5173"
@echo " - Memgraph: localhost:7687 (Lab: localhost:3000)"
@echo " - Jupyter: localhost:8888"
dev-down:
$(COMPOSE_BASE) down
@echo "✅ Development stack stopped"
dev-logs:
$(COMPOSE_BASE) logs -f
dev-status:
$(COMPOSE_BASE) ps
dev-shell:
$(COMPOSE_BASE) exec codenav-web bash
# With monitoring (Redis Insight)
dev-monitoring:
$(COMPOSE_BASE) --profile monitoring up -d
@echo "✅ Development stack with monitoring started"
@echo " - Redis Insight: localhost:5540"
# =============================================================================
# Backend Only (for local frontend development)
# =============================================================================
backend-up:
$(COMPOSE_BACKEND) up -d
@echo "✅ Backend services started"
@echo " Run frontend locally: cd frontend && npm run dev"
backend-down:
$(COMPOSE_BACKEND) down
@echo "✅ Backend services stopped"
backend-logs:
$(COMPOSE_BACKEND) logs -f
# =============================================================================
# GitHub Codespaces
# =============================================================================
codespaces-up:
$(COMPOSE_CODESPACES) up -d --build
@echo "✅ Codespaces stack started"
codespaces-down:
$(COMPOSE_CODESPACES) down
@echo "✅ Codespaces stack stopped"
codespaces-logs:
$(COMPOSE_CODESPACES) logs -f
# =============================================================================
# GHCR Pre-built Images
# =============================================================================
ghcr-up:
$(COMPOSE_GHCR) up -d
@echo "✅ GHCR stack started (using pre-built images)"
ghcr-down:
$(COMPOSE_GHCR) down
@echo "✅ GHCR stack stopped"
ghcr-logs:
$(COMPOSE_GHCR) logs -f
ghcr-pull:
$(COMPOSE_GHCR) pull
@echo "✅ GHCR images pulled"
# =============================================================================
# Infrastructure Management
# =============================================================================
clean:
$(COMPOSE_BASE) down -v --remove-orphans
@echo "✅ All containers and volumes removed"
rebuild:
$(COMPOSE_BASE) build --no-cache
@echo "✅ All images rebuilt"
ps:
$(COMPOSE_BASE) ps
# =============================================================================
# Code Quality
# =============================================================================
lint:
uv run ruff check src/ tests/
@echo "✅ Linting complete"
format:
uv run ruff format src/ tests/
@echo "✅ Code formatted"
# =============================================================================
# Testing
# =============================================================================
test:
uv run pytest tests/ -v
test-coverage:
uv run pytest tests/ --cov=src --cov-report=html
@echo "✅ Coverage report: htmlcov/index.html"
test-watch:
uv run pytest tests/ -v --looponfail
# =============================================================================
# Aliases
# =============================================================================
up: dev-up
down: dev-down
logs: dev-logs
status: dev-status
build: rebuild
.DEFAULT_GOAL := help