2015-08-04 20:52:44 +00:00
|
|
|
UNAME := $(shell sh -c 'uname')
|
2015-08-18 16:16:59 +00:00
|
|
|
VERSION := $(shell sh -c 'git describe --always --tags')
|
2015-08-04 20:52:44 +00:00
|
|
|
|
2015-08-18 16:16:59 +00:00
|
|
|
build: prepare
|
|
|
|
$(GOPATH)/bin/godep go build -o telegraf -ldflags \
|
2015-08-20 22:09:09 +00:00
|
|
|
"-X main.Version $(VERSION)" \
|
2015-08-18 16:16:59 +00:00
|
|
|
./cmd/telegraf/telegraf.go
|
2015-08-04 20:52:44 +00:00
|
|
|
|
2015-07-06 04:46:43 +00:00
|
|
|
prepare:
|
2015-08-18 16:16:59 +00:00
|
|
|
go get github.com/tools/godep
|
2015-08-04 20:52:44 +00:00
|
|
|
|
|
|
|
docker-compose:
|
|
|
|
docker-compose up -d
|
|
|
|
|
2015-08-18 16:16:59 +00:00
|
|
|
test:
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
ADVERTISED_HOST=$(shell sh -c 'boot2docker ip') $(MAKE) test-full
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
ADVERTISED_HOST=localhost $(MAKE) test-full
|
|
|
|
endif
|
|
|
|
|
|
|
|
test-full: prepare docker-compose
|
|
|
|
$(GOPATH)/bin/godep go test -v ./...
|
2015-07-06 04:46:43 +00:00
|
|
|
|
2015-08-04 14:58:32 +00:00
|
|
|
test-short: prepare
|
2015-08-18 16:16:59 +00:00
|
|
|
$(GOPATH)/bin/godep go test -v -short ./...
|
2015-07-06 04:46:43 +00:00
|
|
|
|
2015-08-04 20:52:44 +00:00
|
|
|
test-cleanup:
|
|
|
|
docker-compose kill
|
2015-08-04 14:58:32 +00:00
|
|
|
|
2015-07-06 04:46:43 +00:00
|
|
|
.PHONY: test
|