forked from GoogleCloudPlatform/gke-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (60 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
77 lines (60 loc) · 2.28 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
# Makefile for GKE MCP Server
# Provides convenient shortcuts for common development tasks
.PHONY: help build build-ui run run-http install install-ui test clean presubmit update-version
# Default target - show help
.DEFAULT_GOAL := help
# Variables
BINARY_NAME := gke-mcp
DOCKER_IMAGE := $(BINARY_NAME)
UI_DIR := ui
help: ## Display available commands
@echo "GKE MCP Server - Available Commands"
@echo ""
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
build: build-ui ## Build the binary
@echo "Building $(BINARY_NAME)..."
go build -o $(BINARY_NAME) .
@echo "✓ Built $(BINARY_NAME)"
build-ui: ## Build the UI TypeScript code
@echo "Building UI..."
@npm --prefix $(UI_DIR) run build
@echo "✓ UI built"
run: build-ui build ## Build and run the server
./$(BINARY_NAME)
run-http: build-ui build
./$(BINARY_NAME) --server-mode http --server-port 8080
install: ## Install the binary to GOPATH/bin
@echo "Installing $(BINARY_NAME)..."
go install .
@echo "✓ Installed to $(shell go env GOPATH)/bin/$(BINARY_NAME)"
install-ui: ## Install the UI npm packages
@echo "Installing UI..."
@npm --prefix $(UI_DIR) install
@echo "✓ Installed UI to $(UI_DIR)"
test: ## Run tests
@echo "Running tests..."
go test -v ./...
test-ui: ## Run UI tests
@echo "Running UI tests..."
@npm --prefix $(UI_DIR) run test
clean: ## Remove build artifacts
@echo "Cleaning up..."
@rm -f $(BINARY_NAME)
@rm -f coverage.out coverage.html
@rm -rf dist/
@rm -rf ui/dist/
@echo "✓ Cleaned"
presubmit: ## Run all presubmit checks (build, test, vet, format)
@echo "Running presubmit checks..."
@./dev/tasks/presubmit.sh
@echo "✓ All presubmit checks passed"
update-version: ## Update version. Usage: make update-version [BUMP_TYPE=major|minor|patch]
@echo "Updating version..."
@./dev/tasks/update_version.sh $(BUMP_TYPE)
docker-build: ## Build the docker image
@echo "Building docker image $(DOCKER_IMAGE)..."
docker build -t $(DOCKER_IMAGE) .
@echo "✓ Built docker image $(DOCKER_IMAGE)"
docker-run: docker-build ## Build and run the docker image
@echo "Running docker image $(DOCKER_IMAGE)..."
docker run -it --rm -p 8080:8080 $(DOCKER_IMAGE) --server-mode http --server-host 0.0.0.0