-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.49 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 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
56
57
58
.PHONY: help build install clean test test-e2e fmt vet deps lint lintfix vuln docker
.DEFAULT_GOAL := help
VERSION ?= dev
LDFLAGS := -s -w -X main.serverVersion=$(VERSION)
IMAGE ?= ghcr.io/ionos-cloud/ionoscloud-mcp:$(VERSION)
## help: ## Show this help message
help:
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@awk 'BEGIN {FS = ":.*?## "} /^## [a-zA-Z0-9_-]+:.*?## / {sub(/^## /, ""); printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
## build: ## Build binary (VERSION=<tag> for custom version)
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o ionoscloud-mcp .
## install: ## Install the binary to $GOBIN
install:
go install -trimpath -ldflags "$(LDFLAGS)" .
## test: ## Run unit tests
test:
go test -v -race ./...
## test-e2e: ## Read-only live API checks
test-e2e:
go test -tags e2e_live -count=1 -timeout 20m ./test/live/...
go test -race -tags e2e -count=1 ./test/e2e/...
## fmt: ## Format Go code with gofmt
fmt:
go fmt ./...
## vet: ## Run go vet
vet:
go vet ./...
## lint: ## Run golangci-lint (read-only)
lint:
golangci-lint run --timeout=5m
## lintfix: ## Run golangci-lint with --fix (auto-fixes issues)
lintfix:
golangci-lint run --timeout=5m --fix
## vuln: ## Run govulncheck against all packages
vuln:
govulncheck ./...
## docker: ## Build Docker image from source (IMAGE= to override tag)
docker:
docker build --build-arg VERSION=$(VERSION) -t $(IMAGE) .
check: fmt vet lintfix vuln
@echo "\n===>\n✓ check success!"