-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (66 loc) · 2.1 KB
/
Copy pathMakefile
File metadata and controls
78 lines (66 loc) · 2.1 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
.PHONY: build run run-http test clean lint help
# Build the server binary
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X github.com/MimoJanra/TestOpsMCP/internal/mcp.Version=$(VERSION)"
build:
@echo "Building Allure MCP server ($(VERSION))..."
mkdir -p bin
go build $(LDFLAGS) -o bin/server.exe ./cmd/server
@echo "✓ Server built successfully at bin/server.exe"
# Run server in stdio mode (default)
run: build
@echo "Running server in stdio mode..."
@echo "Make sure environment variables are set:"
@echo " ALLURE_BASE_URL, ALLURE_TOKEN"
@./bin/server.exe
# Run server in HTTP mode (for testing)
run-http: build
@echo "Running server in HTTP mode on :3000..."
@echo "Loading environment from .env..."
@if [ -f .env ]; then set -a; . ./.env; set +a; fi; ./bin/server.exe --http
# Run tests
test:
@echo "Running tests..."
go test ./...
@echo "✓ All tests passed"
# Run linting
lint:
@echo "Running linters..."
go vet ./...
@echo "✓ No issues found"
# Build and run linting
check: lint test
@echo "✓ All checks passed"
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
rm -rf bin/
go clean
@echo "✓ Clean complete - bin/ directory removed"
# Full rebuild
rebuild: clean build
@echo "✓ Rebuild complete"
# Format code
fmt:
@echo "Formatting Go code..."
go fmt ./...
@echo "✓ Formatting complete"
# Display configuration
info:
@echo "Project: Allure MCP Server"
@echo "Module: github.com/MimoJanra/TestOpsMCP"
@echo "Go version required: 1.22+"
@echo ""
@echo "Commands:"
@echo " make build - Build the server binary"
@echo " make run - Run server in stdio mode (local development)"
@echo " make run-http - Run server in HTTP mode (port 3000)"
@echo " make test - Run unit tests"
@echo " make lint - Run Go linter"
@echo " make check - Run lint + tests"
@echo " make fmt - Format Go code"
@echo " make clean - Remove build artifacts"
@echo " make rebuild - Clean and rebuild"
@echo " make help - Show this message"
# Default target
help: info