-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (52 loc) · 1.35 KB
/
Makefile
File metadata and controls
64 lines (52 loc) · 1.35 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
.PHONY: help build test clean fmt vet lint docker push
# Default target
help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " test - Run tests"
@echo " clean - Remove build artifacts"
@echo " fmt - Format Go code"
@echo " vet - Run go vet"
@echo " lint - Run golangci-lint"
@echo " docker - Build Docker image"
@echo " help - Show this help"
# Build the binary
build:
go build -o pod-limit-checker .
# Run tests
test:
go test ./... -v
# Clean build artifacts
clean:
rm -f pod-limit-checker
rm -f pod-limit-checker.exe
rm -rf dist/
rm -rf coverage.out
# Format code
fmt:
go fmt ./...
# Run go vet
vet:
go vet ./...
# Run golangci-lint (if installed)
lint:
golangci-lint run
# Build Docker image
docker:
docker build -t pod-limit-checker:latest .
# Install dependencies
deps:
go mod download
go mod tidy
# Run with sample (development)
run:
go run . --namespace default
# Cross-compile for multiple platforms
cross-build:
GOOS=linux GOARCH=amd64 go build -o dist/pod-limit-checker-linux-amd64 .
GOOS=darwin GOARCH=amd64 go build -o dist/pod-limit-checker-darwin-amd64 .
GOOS=windows GOARCH=amd64 go build -o dist/pod-limit-checker-windows-amd64.exe .
# Generate test coverage
coverage:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html