-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) · 1.05 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
BINARY_NAME := helm-map
MODULE := github.com/senet/helm-map
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS := -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)
.PHONY: build test lint clean install-local release
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY_NAME) ./cmd/helm-map/
test:
go test -v -race -count=1 ./...
lint:
golangci-lint run ./...
clean:
rm -rf bin/
install-local: build
@if [ -z "$$HELM_PLUGINS" ]; then \
echo "HELM_PLUGINS is not set. Run 'helm env' to determine plugin directory."; \
exit 1; \
fi
mkdir -p "$$HELM_PLUGINS/helm-map/bin"
cp bin/$(BINARY_NAME) "$$HELM_PLUGINS/helm-map/bin/"
cp plugin.yaml "$$HELM_PLUGINS/helm-map/"
@echo "Installed to $$HELM_PLUGINS/helm-map/"
release:
goreleaser release --clean
cover:
go test -coverprofile=coverage.out ./internal/engine/...
go tool cover -func=coverage.out
@rm -f coverage.out