aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Kochie <superq@gmail.com>2018-07-23 09:38:39 +0200
committerGitHub <noreply@github.com>2018-07-23 09:38:39 +0200
commit981de58fadfb50c688a274d01e7a382919b4c19a (patch)
tree25fc52b92a49edee60982c6bdfbf13ddff814cea /Makefile
parent23f95c8e04bb21f7a20d93097ace6a5de61c882b (diff)
downloadprometheus_node_collector-981de58fadfb50c688a274d01e7a382919b4c19a.tar.bz2
prometheus_node_collector-981de58fadfb50c688a274d01e7a382919b4c19a.tar.xz
prometheus_node_collector-981de58fadfb50c688a274d01e7a382919b4c19a.zip
Update build (#1010)
* Update from upstream `Makefile.common`. * Update CircleCI with simplifed upstream templating. * Cleanup `Makefile`. Signed-off-by: Ben Kochie <superq@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 9 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index a254ef7..1554954 100644
--- a/Makefile
+++ b/Makefile
@@ -70,14 +70,17 @@ $(eval $(call goarch_pair,mips64el,mipsel))
70 70
71all: style vet staticcheck checkmetrics build test $(cross-test) $(test-e2e) 71all: style vet staticcheck checkmetrics build test $(cross-test) $(test-e2e)
72 72
73.PHONY: test
73test: collector/fixtures/sys/.unpacked 74test: collector/fixtures/sys/.unpacked
74 @echo ">> running tests" 75 @echo ">> running tests"
75 $(GO) test -short $(test-flags) $(pkgs) 76 $(GO) test -short $(test-flags) $(pkgs)
76 77
78.PHONY: test-32bit
77test-32bit: collector/fixtures/sys/.unpacked 79test-32bit: collector/fixtures/sys/.unpacked
78 @echo ">> running tests in 32-bit mode" 80 @echo ">> running tests in 32-bit mode"
79 @env GOARCH=$(GOARCH_CROSS) $(GO) test $(pkgs) 81 @env GOARCH=$(GOARCH_CROSS) $(GO) test $(pkgs)
80 82
83.PHONY: skip-test-32bit
81skip-test-32bit: 84skip-test-32bit:
82 @echo ">> SKIP running tests in 32-bit mode: not supported on $(OS_detected)/$(GOARCH)" 85 @echo ">> SKIP running tests in 32-bit mode: not supported on $(OS_detected)/$(GOARCH)"
83 86
@@ -87,17 +90,21 @@ collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar
87 ./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar 90 ./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar
88 touch $@ 91 touch $@
89 92
93.PHONY: test-e2e
90test-e2e: build collector/fixtures/sys/.unpacked 94test-e2e: build collector/fixtures/sys/.unpacked
91 @echo ">> running end-to-end tests" 95 @echo ">> running end-to-end tests"
92 ./end-to-end-test.sh 96 ./end-to-end-test.sh
93 97
98.PHONY: skip-test-e2e
94skip-test-e2e: 99skip-test-e2e:
95 @echo ">> SKIP running end-to-end tests on $(OS_detected)" 100 @echo ">> SKIP running end-to-end tests on $(OS_detected)"
96 101
102.PHONY: checkmetrics
97checkmetrics: $(PROMTOOL) 103checkmetrics: $(PROMTOOL)
98 @echo ">> checking metrics for correctness" 104 @echo ">> checking metrics for correctness"
99 ./checkmetrics.sh $(PROMTOOL) $(e2e-out) 105 ./checkmetrics.sh $(PROMTOOL) $(e2e-out)
100 106
107.PHONY: docker
101docker: 108docker:
102ifeq ($(MACH), ppc64le) 109ifeq ($(MACH), ppc64le)
103 $(eval DOCKERFILE=Dockerfile.ppc64le) 110 $(eval DOCKERFILE=Dockerfile.ppc64le)
@@ -105,17 +112,11 @@ endif
105 @echo ">> building docker image from $(DOCKERFILE)" 112 @echo ">> building docker image from $(DOCKERFILE)"
106 @docker build --file $(DOCKERFILE) -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . 113 @docker build --file $(DOCKERFILE) -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
107 114
115.PHONY: test-docker
108test-docker: 116test-docker:
109 @echo ">> testing docker image" 117 @echo ">> testing docker image"
110 ./test_image.sh "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100 118 ./test_image.sh "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100
111 119
120.PHONY: promtool $(FIRST_GOPATH)/bin/promtool
112$(FIRST_GOPATH)/bin/promtool promtool: 121$(FIRST_GOPATH)/bin/promtool promtool:
113 @GOOS= GOARCH= $(GO) get -u github.com/prometheus/prometheus/cmd/promtool 122 @GOOS= GOARCH= $(GO) get -u github.com/prometheus/prometheus/cmd/promtool
114
115.PHONY: test-e2e promtool checkmetrics
116
117# Declaring the binaries at their default locations as PHONY targets is a hack
118# to ensure the latest version is downloaded on every make execution.
119# If this is not desired, copy/symlink these binaries to a different path and
120# set the respective environment variables.
121.PHONY: $(FIRST_GOPATH)/bin/promtool