Fix several build issues (#4412)
This commit is contained in:
parent
9e77bfc3ed
commit
5150d565d7
|
@ -31,7 +31,7 @@ which can be found [on our website](http://influxdb.com/community/cla.html)
|
||||||
Assuming you can already build the project, run these in the telegraf directory:
|
Assuming you can already build the project, run these in the telegraf directory:
|
||||||
|
|
||||||
1. `go get -u github.com/golang/dep/cmd/dep`
|
1. `go get -u github.com/golang/dep/cmd/dep`
|
||||||
2. `dep ensure`
|
2. `dep ensure -vendor-only`
|
||||||
3. `dep ensure -add github.com/[dependency]/[new-package]`
|
3. `dep ensure -add github.com/[dependency]/[new-package]`
|
||||||
|
|
||||||
## Input Plugins
|
## Input Plugins
|
||||||
|
|
17
Makefile
17
Makefile
|
@ -1,5 +1,14 @@
|
||||||
|
ifeq ($(SHELL), cmd)
|
||||||
|
VERSION := $(shell git describe --exact-match --tags 2>nil)
|
||||||
|
HOME := $(HOMEPATH)
|
||||||
|
else ifeq ($(SHELL), sh.exe)
|
||||||
|
VERSION := $(shell git describe --exact-match --tags 2>nil)
|
||||||
|
HOME := $(HOMEPATH)
|
||||||
|
else
|
||||||
|
VERSION := $(shell git describe --exact-match --tags 2>/dev/null)
|
||||||
|
endif
|
||||||
|
|
||||||
PREFIX := /usr/local
|
PREFIX := /usr/local
|
||||||
VERSION := $(shell git describe --exact-match --tags 2>/dev/null)
|
|
||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
COMMIT := $(shell git rev-parse --short HEAD)
|
COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
GOFILES ?= $(shell git ls-files '*.go')
|
GOFILES ?= $(shell git ls-files '*.go')
|
||||||
|
@ -8,8 +17,10 @@ BUILDFLAGS ?=
|
||||||
|
|
||||||
ifdef GOBIN
|
ifdef GOBIN
|
||||||
PATH := $(GOBIN):$(PATH)
|
PATH := $(GOBIN):$(PATH)
|
||||||
else
|
else ifdef GOPATH
|
||||||
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
|
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
|
||||||
|
else
|
||||||
|
PATH := $(HOME)/go/bin:$(PATH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
|
LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
|
||||||
|
@ -24,7 +35,7 @@ all:
|
||||||
deps:
|
deps:
|
||||||
go get -u github.com/golang/lint/golint
|
go get -u github.com/golang/lint/golint
|
||||||
go get -u github.com/golang/dep/cmd/dep
|
go get -u github.com/golang/dep/cmd/dep
|
||||||
dep ensure
|
dep ensure -vendor-only
|
||||||
|
|
||||||
telegraf:
|
telegraf:
|
||||||
go build -ldflags "$(LDFLAGS)" ./cmd/telegraf
|
go build -ldflags "$(LDFLAGS)" ./cmd/telegraf
|
||||||
|
|
Loading…
Reference in New Issue