forked from wyukawa/hadoop_exporter
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
64 lines (47 loc) · 1.24 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '-CHANGES' || true)
VERSION := $(shell cat ./VERSION)
DOCKER_REPO := quay.io/tamr/hdfs_exporter
DOCKER_TAG := $(shell cat ./VERSION)
.PHONY: \
clean \
clean-vendor \
deps \
test \
vet \
lint \
build-namenode \
build-resourcemanager \
build-journalnode \
build
all: fmt vet build
clean-vendor:
rm -rf ./vedor/
clean: clean-vendor
deps:
glide install
test: deps
go test -v ./
vet:
go vet -v ./
lint:
golint ./
style:
gofmt -d ./
build-namenode: deps
go fmt ./namenode
go build -o bin/namenode_exporter ./namenode/namenode_exporter.go
build-resourcemanager: deps
go fmt ./resourcemanager
go build -o bin/resourcemanager_exporter ./resourcemanager/resourcemanager_exporter.go
build-journalnode: deps
go fmt ./journalnode
go build -o bin/journalnode_exporter ./journalnode/journalnode_exporter.go
build-datanode: deps
go fmt ./datanode
go build -o bin/datanode_exporter ./datanode/datanode_exporter.go
build: build-namenode build-resourcemanager build-journalnode build-datanode
docker-build:
echo "docker build tag: $(DOCKER_REPO):$(DOCKER_TAG)$(CHANGES)"
docker build -t $(DOCKER_REPO):$(DOCKER_TAG)$(CHANGES) .