-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (52 loc) · 3.6 KB
/
Makefile
File metadata and controls
73 lines (52 loc) · 3.6 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
# Agent Control Plane — common operations
# Usage: make <target>
.PHONY: help setup deploy deploy-workflows run-workflows check frontend backend clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# ── Setup ─────────────────────────────────────────────────────
setup: ## First-time setup: install dependencies, copy .env
@echo "Installing backend dependencies..."
pip install -r control-plane-app/requirements.txt
@echo "Installing frontend dependencies..."
cd control-plane-app/frontend && npm install
@if [ ! -f control-plane-app/.env ]; then \
cp control-plane-app/.env.example control-plane-app/.env; \
echo "Created .env from .env.example — edit it with your values"; \
else \
echo ".env already exists"; \
fi
# ── Deploy ────────────────────────────────────────────────────
deploy: ## Deploy the app (reads config from control-plane-app/.env)
cd control-plane-app && bash deploy.sh
deploy-profile: ## Deploy with a specific CLI profile (usage: make deploy-profile PROFILE=my-profile)
cd control-plane-app && bash deploy.sh --profile $(PROFILE)
deploy-workflows: ## Deploy discovery workflows (usage: make deploy-workflows TARGET=dev)
cd workflows && databricks bundle deploy --target $(or $(TARGET),dev)
run-workflows: ## Trigger a workflow run (usage: make run-workflows TARGET=dev)
cd workflows && databricks bundle run agent_discovery --target $(or $(TARGET),dev) --no-wait
# ── Development ───────────────────────────────────────────────
backend: ## Start backend locally (hot reload)
cd control-plane-app && uvicorn backend.main:app --reload --port 8000
frontend: ## Start frontend dev server
cd control-plane-app/frontend && npm run dev
# ── Quality ───────────────────────────────────────────────────
test: ## Run backend tests with coverage
cd control-plane-app && python -m pytest tests/backend/ -v --tb=short
test-cov: ## Run backend tests with coverage report
cd control-plane-app && python -m pytest tests/backend/ -v --cov=backend --cov-report=term-missing --tb=short
lint: ## Run Python linter (ruff)
cd control-plane-app && ruff check backend/ --select E,F,W --ignore E501,E402
check: ## Run all checks (Python compile + TypeScript type check + lint)
@echo "Checking Python..."
@python3 -c "import py_compile, glob; [py_compile.compile(f, doraise=True) for f in glob.glob('control-plane-app/backend/**/*.py', recursive=True)]"
@echo "Checking TypeScript..."
@cd control-plane-app/frontend && npx tsc --noEmit
@echo "All checks passed"
# ── Lakebase ──────────────────────────────────────────────────
setup-tables: ## Initialize Lakebase tables
cd control-plane-app && python3 ../setup_lakebase_tables.py
# ── Cleanup ───────────────────────────────────────────────────
clean: ## Remove build artifacts
rm -rf control-plane-app/dist
rm -rf control-plane-app/frontend/node_modules/.vite
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true