From 727af126203de85dc995e3549bba1c281f38745c Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Fri, 25 Jan 2019 09:27:48 -0600 Subject: [PATCH 1/2] Makefile: fix for pre-installed promu When using BUILD_PROMU=false, this fixes the circular dependency warning promu->promu, and avoids trying to download promu binary --- Makefile.common | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 4f75c122b5..4a2e25a79d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -29,7 +29,7 @@ GO ?= go GOFMT ?= $(GO)fmt FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH))) ifeq ($(BUILD_PROMU),false) - PROMU := promu + PROMU := $(shell which promu) else PROMU := $(FIRST_GOPATH)/bin/promu endif @@ -199,11 +199,15 @@ common-docker-tag-latest: promu: $(PROMU) $(PROMU): +ifeq ($(BUILD_PROMU),false) + @echo "using installed promu: $(PROMU)" +else $(eval PROMU_TMP := $(shell mktemp -d)) curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP) mkdir -p $(FIRST_GOPATH)/bin cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu rm -r $(PROMU_TMP) +endif .PHONY: proto proto: From 0c139515d21d7a108699d43e14ac949c5632c1a5 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Fri, 25 Jan 2019 09:36:39 -0600 Subject: [PATCH 2/2] update builder image to use go 1.11 --- .promu.yml | 13 ++++++------- Dockerfile | 2 +- Dockerfile.rhel | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.promu.yml b/.promu.yml index 21ea706a18..bf30519436 100644 --- a/.promu.yml +++ b/.promu.yml @@ -10,14 +10,13 @@ build: path: ./cmd/alertmanager - name: amtool path: ./cmd/amtool - flags: -a -tags netgo + flags: -mod vendor -a -tags netgo ldflags: | - -s - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} + -X github.com/prometheus/common/version.Version={{.Version}} + -X github.com/prometheus/common/version.Revision={{.Revision}} + -X github.com/prometheus/common/version.Branch={{.Branch}} + -X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} + -X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} tarball: files: - examples/ha/alertmanager.yml diff --git a/Dockerfile b/Dockerfile index 08c2a4e47a..3035cc338c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager COPY . ${ALERTMANAGER_GOPATH} diff --git a/Dockerfile.rhel b/Dockerfile.rhel index ce1a4357ec..99d2290529 100644 --- a/Dockerfile.rhel +++ b/Dockerfile.rhel @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager ARG BUILD_PROMU=false