-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 895 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 895 Bytes
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
BINARY := deployscope
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null | sed 's/^v//' || echo "dev")
LDFLAGS := -ldflags "-s -w -X main.version=$(VERSION)"
.PHONY: all build test lint fmt clean deps docker-build help
all: deps fmt lint test build
build: ## Build binary
CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY) ./cmd/deployscope
test: ## Run tests with race detection
go test -race -cover ./...
lint: ## Run golangci-lint
golangci-lint run ./...
fmt: ## Format code
gofmt -w .
go run golang.org/x/tools/cmd/goimports@latest -w .
deps: ## Download dependencies
go mod download
docker-build: ## Build Docker image
docker build -t $(BINARY):$(VERSION) .
clean: ## Clean build artifacts
rm -rf bin/ coverage.out
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'