1+ .PHONY : help build test lint lint-fix validate validate-schemas validate-examples integration-test check dev clean docker publisher coverage
2+
3+ # Default target
4+ help : # # Show this help message
5+ @echo " Available targets:"
6+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
7+
8+ # Build targets
9+ build : # # Build the registry application
10+ go build ./cmd/registry
11+
12+ publisher : # # Build the publisher tool
13+ cd tools/publisher && ./build.sh
14+
15+ docker : # # Build Docker image
16+ docker build -t registry .
17+
18+ # Test targets
19+ test : # # Run unit tests
20+ go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/...
21+
22+ integration-test : # # Run integration tests
23+ ./tests/integration/run.sh
24+
25+ test-endpoints : # # Test API endpoints (requires running server)
26+ ./scripts/test_endpoints.sh
27+
28+ test-publish : # # Test publish endpoint (requires BEARER_TOKEN env var)
29+ ./scripts/test_publish.sh
30+
31+ # Validation targets
32+ validate-schemas : # # Validate JSON schemas
33+ ./tools/validate-schemas.sh
34+
35+ validate-examples : # # Validate examples against schemas
36+ ./tools/validate-examples.sh
37+
38+ validate : validate-schemas validate-examples # # Run all validation checks
39+
40+ # Code quality targets
41+ lint : # # Run linter (includes formatting)
42+ golangci-lint run --timeout=5m
43+
44+ lint-fix : # # Run linter with auto-fix (includes formatting)
45+ golangci-lint run --fix --timeout=5m
46+
47+ # Combined targets
48+ check : lint validate test # # Run all checks (lint, validate, test)
49+
50+ pre-commit : check integration-test # # Run all pre-commit checks
51+ @echo " ✅ All pre-commit checks passed!"
52+
53+ # Development targets
54+ dev : # # Start development environment with Docker Compose
55+ docker compose up
56+
57+ dev-local : # # Run registry locally (requires MongoDB)
58+ go run cmd/registry/main.go
59+
60+ # Cleanup
61+ clean : # # Clean build artifacts and coverage files
62+ rm -f registry
63+ rm -f coverage.out
64+ cd tools/publisher && rm -f publisher
65+
66+ # Coverage
67+ coverage : # # Generate test coverage report
68+ go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/...
69+
70+ .DEFAULT_GOAL := help
0 commit comments