aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMatt Layher <mdlayher@gmail.com>2017-02-02 12:50:28 -0500
committerMatt Layher <mdlayher@gmail.com>2017-03-02 10:52:41 -0500
commit748f835171c10dad32ab29dcf1b0b31e89db056b (patch)
tree6982df89af04eab8a40dbef9d30dd9114e6dc404 /Makefile
parent5d22d41ed7d7355979756f6410c6bc01c98ca5af (diff)
downloadprometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.tar.bz2
prometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.tar.xz
prometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.zip
Run staticcheck from Makefile, remove duplicate end-to-end test call in CI
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index c0dfe7d..741f4a9 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,10 @@
13 13
14GO ?= GO15VENDOREXPERIMENT=1 go 14GO ?= GO15VENDOREXPERIMENT=1 go
15GOPATH := $(firstword $(subst :, ,$(GOPATH))) 15GOPATH := $(firstword $(subst :, ,$(GOPATH)))
16PROMU ?= $(GOPATH)/bin/promu 16
17pkgs = $(shell $(GO) list ./... | grep -v /vendor/) 17PROMU ?= $(GOPATH)/bin/promu
18STATICCHECK ?= $(GOPATH)/bin/staticcheck
19pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
18 20
19PREFIX ?= $(shell pwd) 21PREFIX ?= $(shell pwd)
20BIN_DIR ?= $(shell pwd) 22BIN_DIR ?= $(shell pwd)
@@ -33,7 +35,7 @@ else
33 test-e2e := skip-test-e2e 35 test-e2e := skip-test-e2e
34endif 36endif
35 37
36all: format build test $(test-e2e) 38all: format vet staticcheck build test $(test-e2e)
37 39
38style: 40style:
39 @echo ">> checking code style" 41 @echo ">> checking code style"
@@ -58,6 +60,10 @@ vet:
58 @echo ">> vetting code" 60 @echo ">> vetting code"
59 @$(GO) vet $(pkgs) 61 @$(GO) vet $(pkgs)
60 62
63staticcheck: $(STATICCHECK)
64 @echo ">> running staticcheck"
65 @$(STATICCHECK) $(pkgs)
66
61build: $(PROMU) 67build: $(PROMU)
62 @echo ">> building binaries" 68 @echo ">> building binaries"
63 @$(PROMU) build --prefix $(PREFIX) 69 @$(PROMU) build --prefix $(PREFIX)
@@ -71,9 +77,10 @@ docker:
71 @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . 77 @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
72 78
73$(GOPATH)/bin/promu promu: 79$(GOPATH)/bin/promu promu:
74 @GOOS=$(shell uname -s | tr A-Z a-z) \ 80 @GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu
75 GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ 81
76 $(GO) get -u github.com/prometheus/promu 82$(GOPATH)/bin/staticcheck:
83 @GOOS= GOARCH= $(GO) get -u honnef.co/go/tools/cmd/staticcheck
77 84
78 85
79.PHONY: all style format build test test-e2e vet tarball docker promu $(GOPATH)/bin/promu 86.PHONY: all style format build test test-e2e vet tarball docker promu staticcheck $(GOPATH)/bin/promu $(GOPATH)/bin/staticcheck