makefile: fix make file to run go generate

pull/10616/head
Michael Desa 2018-07-23 17:42:03 -04:00
parent 21e8509ca3
commit dc7418f7fe
5 changed files with 44 additions and 5 deletions

View File

@ -3,7 +3,7 @@ jobs:
build:
docker:
# specify the version
- image: circleci/golang:1.10.2
- image: circleci/golang:1.10.3-node-browsers
working_directory: /go/src/github.com/influxdata/platform
steps:

5
.gitignore vendored
View File

@ -13,3 +13,8 @@ idpdb.bolt
/fluxd
/transpilerd
/bin
yarn.lock
node_modules
.godep
.jsdep

8
Gopkg.lock generated
View File

@ -443,6 +443,12 @@
packages = ["."]
revision = "d1898390779332322e6b5ca5011da4bf249bb056"
[[projects]]
name = "github.com/kevinburke/go-bindata"
packages = ["."]
revision = "fb8a22f0e4d56d895765b12de81fcc127b096a77"
version = "v3.9.0"
[[projects]]
name = "github.com/magiconair/properties"
packages = ["."]
@ -841,6 +847,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "0c99d4557f7029cca0e72a5895fc448d7ebd02e187f3d2fa3c0b167855ba8f39"
inputs-digest = "71484856c934c966b4322dfb4c502a190b6ac0538a67d37f616cbe0010eaa5e4"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -29,7 +29,8 @@ required = [
# Pigeon is the command used to generate the Flux parser from the PEG description
"github.com/mna/pigeon",
# goreleaser is a utility to build and upload to S3
"github.com/goreleaser/goreleaser"
"github.com/goreleaser/goreleaser",
"github.com/kevinburke/go-bindata"
]
[[constraint]]

View File

@ -12,13 +12,17 @@
#
SUBDIRS := query
GOBINDATA := $(shell go list -f {{.Root}} github.com/kevinburke/go-bindata 2> /dev/null)
UISOURCES := $(shell find chronograf/ui -type f -not \( -path chronograf/ui/build/\* -o -path chronograf/ui/node_modules/\* -prune \) )
YARN := $(shell command -v yarn 2> /dev/null)
GO_ARGS=-tags '$(GO_TAGS)'
# Test vars can be used by all recursive Makefiles
export GOOS=$(shell go env GOOS)
export GO_BUILD=go build $(GO_ARGS)
export GO_TEST=go test $(GO_ARGS)
export GO_TEST=go test -count=1 $(GO_ARGS)
export GO_GENERATE=go generate $(GO_ARGS)
export GO_VET= go vet $(GO_ARGS)
@ -46,7 +50,7 @@ UTILS := \
#
# This target setups the dependencies to correctly build all commands.
# Other targets must depend on this target to correctly builds CMDS.
all: Gopkg.lock $(UTILS) subdirs $(CMDS)
all: dep Gopkg.lock $(UTILS) subdirs $(CMDS)
# Target to build subdirs.
# Each subdirs must support the `all` target.
@ -72,6 +76,23 @@ bin/$(GOOS)/cmpgen: ./query/ast/asttest/cmpgen/main.go
bin/$(GOOS)/goreleaser: ./vendor/github.com/goreleaser/goreleaser/main.go
go build -i -o $@ ./vendor/github.com/goreleaser/goreleaser
dep: .jsdep .godep
.godep:
ifndef GOBINDATA
@echo "Installing go-bindata"
go get -u github.com/kevinburke/go-bindata/...
endif
@touch .godep
.jsdep: chronograf/ui/yarn.lock
ifndef YARN
$(error Please install yarn 0.19.1+)
else
mkdir -p chronograf/ui/build && cd chronograf/ui && yarn --no-progress --no-emoji
@touch .jsdep
endif
#
# Define how source dependencies are managed
#
@ -94,9 +115,15 @@ fmt: $(SOURCES_NO_VENDOR)
goimports -w $^
test: all
$(GO_GENERATE) ./chronograf/dist
$(GO_GENERATE) ./chronograf/server
$(GO_GENERATE) ./chronograf/canned
$(GO_TEST) ./...
test-race: all
$(GO_GENERATE) ./chronograf/dist
$(GO_GENERATE) ./chronograf/server
$(GO_GENERATE) ./chronograf/canned
$(GO_TEST) -race ./...
vet: all