-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 2.46 KB
/
Copy pathMakefile
File metadata and controls
65 lines (52 loc) · 2.46 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
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
GOBIN ?= $(shell go env GOBIN)
GOPATH ?= $(shell go env GOPATH)
GO_BIN_DIR ?= $(if $(GOBIN),$(GOBIN),$(GOPATH)/bin)
GOIMPORTS ?= $(shell command -v goimports 2>/dev/null || echo $(GO_BIN_DIR)/goimports)
fmt:
@echo "🧹 Running go fmt..."
@go fmt ./...
goimports:
@echo "📦 Running goimports..."
@if [ ! -x "$(GOIMPORTS)" ]; then \
echo "goimports not found at $(GOIMPORTS) or on PATH."; \
echo "Install it with: go install golang.org/x/tools/cmd/goimports@latest"; \
exit 1; \
else \
$(GOIMPORTS) -w .; \
fi
build: fmt goimports
@echo "🚀 Building ..."
@go build $(GO_FLAGS) -ldflags "-X github.com/SigNoz/signoz-mcp-server/pkg/version.Version=$(VERSION)" -o bin/signoz-mcp-server ./cmd/server/...
test:
@echo "🧪 Running all tests..."
@go test -v ./...
##@ E2E
E2E_FLAGS ?=
test-e2e: ## Runs the e2e suite against a freshly cast SigNoz, tearing it down afterwards.
@echo "🧪 Running e2e suite..."
@cd tests && uv sync && uv run pytest --basetemp=./tmp/ e2e/tests $(E2E_FLAGS)
test-e2e-reuse: ## Runs the e2e suite reusing the cached SigNoz environment.
@echo "🧪 Running e2e suite (--reuse)..."
@cd tests && uv sync && uv run pytest --basetemp=./tmp/ --reuse e2e/tests $(E2E_FLAGS)
setup-e2e-env: ## Brings the e2e environment up and keeps it for --reuse runs.
@echo "🚀 Setting up the e2e environment..."
@cd tests && uv sync && uv run pytest --basetemp=./tmp/ --reuse e2e/bootstrap/setup.py::test_setup $(E2E_FLAGS)
cleanup-test-e2e: ## Tears down the cached e2e environment.
@echo "🧹 Tearing down the e2e environment..."
@cd tests && uv sync && uv run pytest --basetemp=./tmp/ --teardown e2e/bootstrap/setup.py::test_teardown $(E2E_FLAGS)
docs-index:
@echo "📚 Rebuilding embedded SigNoz docs corpus (fail-loud if signoz.io/docs/sitemap.md is unreachable)..."
@go run ./cmd/build-docs-index
@echo "✅ corpus.gob.gz + corpus.manifest.json regenerated. Diff the manifest and commit both files."
bundle:
@echo "🚀 Building SigNoz Claude MCP extension..."
@mkdir -p bundle/server
@GOOS=darwin GOARCH=arm64 go build -o bundle/server/signoz-mcp-server ./cmd/server/
@GOOS=windows GOARCH=amd64 go build -o bundle/server/signoz-mcp-server.exe ./cmd/server/
@cp ./manifest.json bundle/
@cp ./assets/signoz_icon.png bundle/
@echo "📦 Installing MCPB CLI..."
@npm install -g @anthropic-ai/mcpb > /dev/null 2>&1
@echo "🧩 Packing MCP bundle..."
cd bundle && mcpb pack