Update Makefile with new build requirements
This commit is contained in:
28
Makefile
28
Makefile
@@ -1,23 +1,31 @@
|
||||
UNAME := $(shell sh -c 'uname')
|
||||
VERSION := $(shell sh -c 'git describe --always --tags')
|
||||
|
||||
ifeq ($(UNAME), Darwin)
|
||||
export ADVERTISED_HOST := $(shell sh -c 'boot2docker ip')
|
||||
endif
|
||||
ifeq ($(UNAME), Linux)
|
||||
export ADVERTISED_HOST := localhost
|
||||
endif
|
||||
build: prepare
|
||||
$(GOPATH)/bin/godep go build -o telegraf -ldflags \
|
||||
"-X main.Version $(VERSION)" \
|
||||
./cmd/telegraf/telegraf.go
|
||||
|
||||
prepare:
|
||||
godep go install ./...
|
||||
go get github.com/tools/godep
|
||||
$(GOPATH)/bin/godep go install ./...
|
||||
|
||||
docker-compose:
|
||||
docker-compose up -d
|
||||
|
||||
test: prepare docker-compose
|
||||
godep go test -v ./...
|
||||
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 ./...
|
||||
|
||||
test-short: prepare
|
||||
godep go test -v -short ./...
|
||||
$(GOPATH)/bin/godep go test -v -short ./...
|
||||
|
||||
test-cleanup:
|
||||
docker-compose kill
|
||||
|
||||
Reference in New Issue
Block a user