forked from jacksontj/mongodb_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
22 lines (18 loc) · 815 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package = github.com/dcu/mongodb_exporter
TAG := $(shell git tag | sort -r | head -n 1)
test:
go test github.com/dcu/mongodb_exporter/collector -cover -coverprofile=collector_coverage.out -short
go tool cover -func=collector_coverage.out
go test github.com/dcu/mongodb_exporter/shared -cover -coverprofile=shared_coverage.out -short
go tool cover -func=shared_coverage.out
@rm *.out
deps:
glide install
build: deps
CGO_ENABLED=0 go build mongodb_exporter.go
release: deps
mkdir -p release
perl -p -i -e 's/\{\{VERSION\}\}/$(TAG)/g' mongodb_exporter.go
GOOS=darwin GOARCH=amd64 go build -o release/mongodb_exporter-darwin-amd64 $(package)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o release/mongodb_exporter-linux-amd64 $(package)
perl -p -i -e 's/$(TAG)/\{\{VERSION\}\}/g' mongodb_exporter.go