-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.49 KB
/
Makefile
File metadata and controls
55 lines (46 loc) · 1.49 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
.PHONY: build test clean run docker
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
BINARY_NAME=k8s-mcp-server
BINARY_PATH=./bin/$(BINARY_NAME)
# Build the application
build:
mkdir -p bin
$(GOBUILD) -o $(BINARY_PATH) -v ./cmd/server
# Run tests
test:
$(GOTEST) -v ./...
# Clean build artifacts
clean:
$(GOCLEAN)
rm -f $(BINARY_PATH)
# Run the application
run: build
$(BINARY_PATH)
# Download dependencies
deps:
$(GOMOD) download
$(GOMOD) tidy
# Quick MCP test
mcp-test: build
@echo "Testing MCP initialization..."
@echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"resources":{}},"clientInfo":{"name":"test","version":"1.0.0"}}}' | $(BINARY_PATH)
# List resources test
list-test: build
@echo "Testing resource listing..."
@echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"resources":{}},"clientInfo":{"name":"test","version":"1.0.0"}}}' | $(BINARY_PATH) && \
echo '{"jsonrpc":"2.0","id":2,"method":"resources/list","params":{}}' | $(BINARY_PATH)
help:
@echo "Available targets:"
@echo " build - Build the application"
@echo " test - Run unit tests"
@echo " clean - Clean build artifacts"
@echo " run - Build and run the application"
@echo " deps - Download dependencies"
@echo " mcp-test - Quick MCP protocol test"
@echo " list-test - Test resource listing"