forked from monicasarbu/topbeat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (35 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
42
GODEP=$(GOPATH)/bin/godep
PREFIX?=/build
GOFILES = $(shell find . -type f -name '*.go')
topbeat: $(GOFILES)
# first make sure we have godep
go get github.com/tools/godep
$(GODEP) go build
.PHONY: getdeps
getdeps:
go get -t -u -f
.PHONY: test
test:
$(GODEP) go test ./...
.PHONY: install-cfg
install-cfg:
cp etc/topbeat.template.json $(PREFIX)/topbeat.template.json
# linux
cp etc/topbeat.yml $(PREFIX)/topbeat-linux.yml
# binary
cp etc/topbeat.yml $(PREFIX)/topbeat-binary.yml
# darwin
cp etc/topbeat.yml $(PREFIX)/topbeat-darwin.yml
# win
cp etc/topbeat.yml $(PREFIX)/topbeat-win.yml
.PHONY: cover
cover:
# gotestcover is needed to fetch coverage for multiple packages
go get github.com/pierrre/gotestcover
GOPATH=$(shell $(GODEP) path):$(GOPATH) $(GOPATH)/bin/gotestcover -coverprofile=profile.cov -covermode=count github.com/elastic/topbeat/...
mkdir -p cover
$(GODEP) go tool cover -html=profile.cov -o cover/coverage.html
.PHONY: clean
clean:
rm topbeat || true
-rm -r cover