forked from Datatamer/hadoop_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (40 loc) · 1.31 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
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 \
test \
vet \
lint \
build-namenode \
build-resourcemanager \
build-journalnode \
build
all: fmt vet build
test:
go test -v ./
vet:
go vet -v ./
lint:
golint ./
style:
gofmt -d ./
build-namenode:
go fmt ./namenode
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o bin/namenode_exporter ./namenode/namenode_exporter.go
build-resourcemanager:
go fmt ./resourcemanager
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o bin/resourcemanager_exporter ./resourcemanager/resourcemanager_exporter.go
build-journalnode:
go fmt ./journalnode
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o bin/journalnode_exporter ./journalnode/journalnode_exporter.go
build-datanode:
go fmt ./datanode
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -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) .