forked from cpanato/helm-schema-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.37 KB
/
Makefile
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
GOPATH := $(shell go env GOPATH)
BIN_NAME := helm-schema-gen
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
FORCE: ;
.PHONY: deps
deps: ## Download go dependencies
@echo Downloading dependencies
@go mod download
.PHONY: clean
clean-build: ## Removes the bin folder
rm -rf bin
bin/%: cmd/% FORCE
@echo Building binary
go build -o $@ ./$<
.PHONY: build
build: deps bin/$(BIN_NAME) ## Build the binary
.PHONY: lint
lint: ## use goimports to lint
@$(GOPATH)/bin/goimports -d -e -local github.com/cpanato/helm-schema-gen $$(go list -f {{.Dir}} ./...)
.PHONY: bench
bench: ## Run benchmarks
go test -bench=. ./...
.PHONY: test
test: ## Run tests
go test -race -v -count=1 ./...
.PHONY: coverage
coverage: ## Run the tests with coverage
go test -race -v -count=1 -covermode=atomic -coverprofile=coverage.out ./...
.PHONY: coverage-out
coverage-out: coverage ## Output code coverage at the CLI
go tool cover -func=coverage.out
.PHONY: coverage-html
coverage-html: coverage ## Output code coverage as HTML
go tool cover -html=coverage.out
.PHONY: outdated
outdated: ## Checks for outdated dependencies
go list -u -m -json all | go-mod-outdated -update
.PHONY: install
install: build ## Installs the plugin from GitHub using version defined in plugin.yaml
helm plugin install .