aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Kochie <superq@gmail.com>2018-11-30 14:01:20 +0100
committerGitHub <noreply@github.com>2018-11-30 14:01:20 +0100
commitbecca1275c77ffab31ec7082b3bd9ba9382a6c1a (patch)
tree3c201ab4743d461ecdb9ccd39928c3a9dd2a4948 /Makefile
parent1732478361a57dea9f7cd0f319c5a34cebcf047d (diff)
downloadprometheus_node_collector-becca1275c77ffab31ec7082b3bd9ba9382a6c1a.tar.bz2
prometheus_node_collector-becca1275c77ffab31ec7082b3bd9ba9382a6c1a.tar.xz
prometheus_node_collector-becca1275c77ffab31ec7082b3bd9ba9382a6c1a.zip
Convert to Go modules (#1178)
* Convert to Go modules * Update promu config. * Convert to Go modules. * Update vendoring. * Update Makefile.common. * Update circleci config. * Use Prometheus release tar for promtool. * Fixup unpack * Use temp dir for unpacking tools. * Use BSD compatible tar command. * OpenBSD mkdir doesn't support `-v`. Signed-off-by: Ben Kochie <superq@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 14 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 459c762..2565f56 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,9 @@ GO ?= GO15VENDOREXPERIMENT=1 go
17GOARCH := $(shell $(GO) env GOARCH) 17GOARCH := $(shell $(GO) env GOARCH)
18GOHOSTARCH := $(shell $(GO) env GOHOSTARCH) 18GOHOSTARCH := $(shell $(GO) env GOHOSTARCH)
19 19
20PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool 20PROMTOOL_VERSION ?= 2.5.0
21PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
22PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
21 23
22DOCKER_IMAGE_NAME ?= node-exporter 24DOCKER_IMAGE_NAME ?= node-exporter
23MACH ?= $(shell uname -m) 25MACH ?= $(shell uname -m)
@@ -139,6 +141,14 @@ test-docker:
139 @echo ">> testing docker image" 141 @echo ">> testing docker image"
140 ./test_image.sh "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100 142 ./test_image.sh "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100
141 143
142.PHONY: promtool $(FIRST_GOPATH)/bin/promtool 144.PHONY: promtool
143$(FIRST_GOPATH)/bin/promtool promtool: 145promtool: $(PROMTOOL)
144 @GOOS= GOARCH= $(GO) get -u github.com/prometheus/prometheus/cmd/promtool 146
147.PHONY: $(PROMTOOL)
148$(PROMTOOL):
149 $(eval PROMTOOL_TMP := $(shell mktemp -d))
150 curl -s -L $(PROMTOOL_URL) | tar -xvzf - -C $(PROMTOOL_TMP)
151 mkdir -p $(FIRST_GOPATH)/bin
152 cp $(PROMTOOL_TMP)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM)/promtool $(FIRST_GOPATH)/bin/promtool
153 rm -r $(PROMTOOL_TMP)
154