From a2b99017279d16976445ee7154d22a39840577c3 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Mon, 13 Mar 2017 17:10:50 -0500 Subject: [PATCH] build: Add Vault as an external test dependency Vault is required for the fingerprinting tests but is not currently installed by the build process. This commit adds a new category of external tools for test dependencies and `go get`'s them during the bootstrap. We also fix the syntax of the Makefile to use tabs throughout. --- GNUmakefile | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 1f849836c..806fdad1f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,11 +1,14 @@ PACKAGES = $(shell go list ./... | grep -v '/vendor/') EXTERNAL_TOOLS=\ - github.com/kardianos/govendor \ - github.com/mitchellh/gox \ - golang.org/x/tools/cmd/cover \ - github.com/axw/gocov/gocov \ - gopkg.in/matm/v1/gocov-html \ - github.com/ugorji/go/codec/codecgen + github.com/kardianos/govendor \ + github.com/mitchellh/gox \ + golang.org/x/tools/cmd/cover \ + github.com/axw/gocov/gocov \ + gopkg.in/matm/v1/gocov-html \ + github.com/ugorji/go/codec/codecgen + +TEST_TOOLS=\ + github.com/hashicorp/vault all: test @@ -27,7 +30,7 @@ test: generate @if [ -n "`go fmt ${PACKAGES}`" ]; then \ echo "[ERR] go fmt updated formatting. Please commit formatted code first."; \ exit 1; \ - fi + fi @sh -c "'$(PWD)/scripts/test.sh'" @$(MAKE) vet @@ -50,18 +53,21 @@ vet: echo "[LINT] Vet found suspicious constructs. Please check the reported constructs"; \ echo "and fix them if necessary before submitting the code for review."; \ exit 1; \ - fi - + fi @git grep -n `echo "log"".Print"` | grep -v 'vendor/' ; if [ $$? -eq 0 ]; then \ echo "[LINT] Found "log"".Printf" calls. These should use Nomad's logger instead."; \ - fi + fi # bootstrap the build by downloading additional tools bootstrap: @for tool in $(EXTERNAL_TOOLS) ; do \ echo "Installing $$tool" ; \ - go get $$tool; \ - done + go get $$tool; \ + done + @for tool in $(TEST_TOOLS) ; do \ + echo "Installing $$tool (test dependency)" ; \ + go get $$tool; \ + done install: bin/nomad install -o root -g wheel -m 0755 ./bin/nomad /usr/local/bin/nomad