forked from cloudflare/kafka_zookeeper_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (30 loc) · 790 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
NAME := kafka_zookeeper_exporter
VERSION := $(shell git describe --tags --always --dirty='-dev')
SOURCES := $(wildcard *.go) $(wildcard */*.go)
$(NAME): $(SOURCES)
go build -ldflags "-X main.version=$(shell git describe --tags --always --dirty=-dev)"
.PHONY: build
build: $(NAME)
.PHONY: build-docker
build-docker:
docker build --build-arg VERSION=$(VERSION) -t $(NAME):$(VERSION) .
.PHONY: test
test: lint
go test $(go list ./... | grep -v /vendor/)
.PHONY: lint
lint:
golint ./... | (egrep -v ^vendor/ || true)
.build/dep.ok:
go install github.com/golang/dep/cmd/dep
@mkdir -p .build
touch $@
.PHONY: vendor
vendor: .build/dep.ok
dep ensure
dep prune
.PHONY: vendor-update
vendor-update: .build/dep.ok
dep ensure -update
dep prune
.PHONY: all
all: lint test build