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>
This commit is contained in:
parent
1732478361
commit
becca1275c
80 changed files with 4199 additions and 483 deletions
18
Makefile
18
Makefile
|
|
@ -17,7 +17,9 @@ GO ?= GO15VENDOREXPERIMENT=1 go
|
|||
GOARCH := $(shell $(GO) env GOARCH)
|
||||
GOHOSTARCH := $(shell $(GO) env GOHOSTARCH)
|
||||
|
||||
PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
|
||||
PROMTOOL_VERSION ?= 2.5.0
|
||||
PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
|
||||
PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
|
||||
|
||||
DOCKER_IMAGE_NAME ?= node-exporter
|
||||
MACH ?= $(shell uname -m)
|
||||
|
|
@ -139,6 +141,14 @@ test-docker:
|
|||
@echo ">> testing docker image"
|
||||
./test_image.sh "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" 9100
|
||||
|
||||
.PHONY: promtool $(FIRST_GOPATH)/bin/promtool
|
||||
$(FIRST_GOPATH)/bin/promtool promtool:
|
||||
@GOOS= GOARCH= $(GO) get -u github.com/prometheus/prometheus/cmd/promtool
|
||||
.PHONY: promtool
|
||||
promtool: $(PROMTOOL)
|
||||
|
||||
.PHONY: $(PROMTOOL)
|
||||
$(PROMTOOL):
|
||||
$(eval PROMTOOL_TMP := $(shell mktemp -d))
|
||||
curl -s -L $(PROMTOOL_URL) | tar -xvzf - -C $(PROMTOOL_TMP)
|
||||
mkdir -p $(FIRST_GOPATH)/bin
|
||||
cp $(PROMTOOL_TMP)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM)/promtool $(FIRST_GOPATH)/bin/promtool
|
||||
rm -r $(PROMTOOL_TMP)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue