-
Notifications
You must be signed in to change notification settings - Fork 7
/
GNUmakefile
52 lines (46 loc) · 1.44 KB
/
GNUmakefile
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
default: check test build
tools: ## Install the tools used to test and build
@echo "==> Installing build tools"
go get github.com/ahmetb/govvv
go get github.com/alecthomas/gometalinter
go get github.com/goreleaser/goreleaser
gometalinter --install
build: ## Build nomad-toast for development purposes
@echo "==> Running $@..."
govvv build -o ./bin/nomad-toast ./cmd/nomad-toast -version local -pkg "github.com/jrasell/nomad-toast/pkg/buildconsts"
test: ## Run the nomad-toast test suite with coverage
@echo "==> Running $@..."
@go test -cover -v -tags -race \
"$(BUILDTAGS)" $(shell go list ./... | grep -v vendor)
release: ## Trigger the release build script
@echo "==> Running $@..."
@goreleaser --rm-dist --config=./cmd/nomad-toast/goreleaser.yml
.PHONY: check
check: ## Run the gometalinter suite
@echo "==> Running $@..."
gometalinter \
--deadline 10m \
--vendor \
--sort="path" \
--aggregate \
--disable-all \
--enable golint \
--enable-gc \
--enable goimports \
--enable misspell \
--enable vet \
--enable deadcode \
--enable varcheck \
--enable ineffassign \
--enable structcheck \
--enable errcheck \
--enable gofmt \
./...
HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"
.PHONY: help
help: ## Display this usage information
@echo "nomad-toast make commands:"
@grep -E '^[^ ]+:.*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ":.*?## "}; \
{printf $(HELP_FORMAT), $$1, $$2}'