From b1e779d0edca9c7b3db29a8b73345a94597108c6 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sat, 10 Nov 2018 16:28:59 +0100 Subject: [PATCH] Use release binary of promu (#4843) Download and extract a release binary of promu, rather than pull from master. Signed-off-by: Ben Kochie --- Makefile.common | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile.common b/Makefile.common index f19ed6389..58336209e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -33,6 +33,12 @@ STATICCHECK := $(FIRST_GOPATH)/bin/staticcheck GOVENDOR := $(FIRST_GOPATH)/bin/govendor pkgs = ./... +GO_VERSION ?= $(shell $(GO) version) +GO_BUILD_PLATFORM ?= $(subst /,-,$(lastword $(GO_VERSION))) + +PROMU_VERSION ?= 0.2.0 +PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz + PREFIX ?= $(shell pwd) BIN_DIR ?= $(shell pwd) DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) @@ -120,8 +126,12 @@ common-docker-tag-latest: docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):latest" .PHONY: promu -promu: - GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu +promu: $(PROMU) + +$(PROMU): + curl -s -L $(PROMU_URL) | tar -xvz -C /tmp + mkdir -v -p $(FIRST_GOPATH)/bin + cp -v /tmp/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(PROMU) .PHONY: proto proto: