-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
41 lines (31 loc) · 1008 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
GO := go
PROMU := $(GOPATH)/bin/promu
PROMU_VERSION := 0.15.0
PKGS = $(shell $(GO) list ./... | grep -v /vendor/)
PREFIX ?= $(shell pwd)
BIN_DIR ?= $(shell pwd)
all: test build
test:
@echo ">> running tests"
go test -short $(PKGS)
build: promu
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX)
tarball: promu
@echo ">> building release tarball"
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
tarballs: promu
@echo ">> building release tarballs"
@$(PROMU) crossbuild tarballs
@echo ">> calculating release checksums"
@$(PROMU) checksum $(BIN_DIR)/.tarballs
crossbuild: promu
@echo ">> cross-building binaries"
@$(PROMU) crossbuild
release: promu
@echo ">> create release"
@$(PROMU) release --verbose --timeout=120s --retry=30 $(BIN_DIR)/.tarballs
promu:
@GOOS=$(shell uname -s | tr A-Z a-z) \
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
$(GO) install github.com/prometheus/promu@v$(PROMU_VERSION)