Skip to content

Commit

Permalink
Fix several build issues (influxdata#4412)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored Jul 12, 2018
1 parent 9e77bfc commit 5150d56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

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]`

## Input Plugins
Expand Down
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
VERSION := $(shell git describe --exact-match --tags 2>/dev/null)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git rev-parse --short HEAD)
GOFILES ?= $(shell git ls-files '*.go')
Expand All @@ -8,8 +17,10 @@ BUILDFLAGS ?=

ifdef GOBIN
PATH := $(GOBIN):$(PATH)
else
else ifdef GOPATH
PATH := $(subst :,/bin:,$(GOPATH))/bin:$(PATH)
else
PATH := $(HOME)/go/bin:$(PATH)
endif

LDFLAGS := $(LDFLAGS) -X main.commit=$(COMMIT) -X main.branch=$(BRANCH)
Expand All @@ -24,7 +35,7 @@ all:
deps:
go get -u github.com/golang/lint/golint
go get -u github.com/golang/dep/cmd/dep
dep ensure
dep ensure -vendor-only

telegraf:
go build -ldflags "$(LDFLAGS)" ./cmd/telegraf
Expand Down

0 comments on commit 5150d56

Please sign in to comment.