Skip to content

Commit 4617d55

Browse files
Merge pull request #20 from pgier/makefile-promu-fix
Makefile promu fix
2 parents eb8f901 + 0c13951 commit 4617d55

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.promu.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ build:
1010
path: ./cmd/alertmanager
1111
- name: amtool
1212
path: ./cmd/amtool
13-
flags: -a -tags netgo
13+
flags: -mod vendor -a -tags netgo
1414
ldflags: |
15-
-s
16-
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}}
17-
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}}
18-
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}}
19-
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
20-
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
15+
-X github.com/prometheus/common/version.Version={{.Version}}
16+
-X github.com/prometheus/common/version.Revision={{.Revision}}
17+
-X github.com/prometheus/common/version.Branch={{.Branch}}
18+
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
19+
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
2120
tarball:
2221
files:
2322
- examples/ha/alertmanager.yml

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder
1+
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder
22

33
ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager
44
COPY . ${ALERTMANAGER_GOPATH}

Dockerfile.rhel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder
1+
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder
22

33
ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager
44
ARG BUILD_PROMU=false

Makefile.common

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ GO ?= go
2929
GOFMT ?= $(GO)fmt
3030
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
3131
ifeq ($(BUILD_PROMU),false)
32-
PROMU := promu
32+
PROMU := $(shell which promu)
3333
else
3434
PROMU := $(FIRST_GOPATH)/bin/promu
3535
endif
@@ -199,11 +199,15 @@ common-docker-tag-latest:
199199
promu: $(PROMU)
200200

201201
$(PROMU):
202+
ifeq ($(BUILD_PROMU),false)
203+
@echo "using installed promu: $(PROMU)"
204+
else
202205
$(eval PROMU_TMP := $(shell mktemp -d))
203206
curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
204207
mkdir -p $(FIRST_GOPATH)/bin
205208
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
206209
rm -r $(PROMU_TMP)
210+
endif
207211

208212
.PHONY: proto
209213
proto:

0 commit comments

Comments
 (0)