Skip to content

Commit

Permalink
Merge pull request #20 from pgier/makefile-promu-fix
Browse files Browse the repository at this point in the history
Makefile promu fix
  • Loading branch information
openshift-merge-robot authored Jan 25, 2019
2 parents eb8f901 + 0c13951 commit 4617d55
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
13 changes: 6 additions & 7 deletions .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4617d55

Please sign in to comment.