mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
Added a bootstrap target in the makefile to download required tools and updated the README.md instructions
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -45,4 +45,5 @@ Vagrantfile
|
|||||||
*.hcl
|
*.hcl
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.idea
|
||||||
|
|
||||||
|
|||||||
20
Makefile
20
Makefile
@@ -1,5 +1,10 @@
|
|||||||
TEST?=./...
|
TEST?=./...
|
||||||
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
|
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
|
||||||
|
EXTERNAL_TOOLS=\
|
||||||
|
github.com/tools/godep \
|
||||||
|
github.com/mitchellh/gox \
|
||||||
|
golang.org/x/tools/cmd/cover \
|
||||||
|
golang.org/x/tools/cmd/vet
|
||||||
|
|
||||||
default: test
|
default: test
|
||||||
|
|
||||||
@@ -29,17 +34,11 @@ testrace: generate
|
|||||||
TF_ACC= godep go test -race $(TEST) $(TESTARGS)
|
TF_ACC= godep go test -race $(TEST) $(TESTARGS)
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
@go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \
|
|
||||||
go get -u golang.org/x/tools/cmd/cover; \
|
|
||||||
fi
|
|
||||||
./scripts/coverage.sh --html
|
./scripts/coverage.sh --html
|
||||||
|
|
||||||
# vet runs the Go source code static analysis tool `vet` to find
|
# vet runs the Go source code static analysis tool `vet` to find
|
||||||
# any common errors.
|
# any common errors.
|
||||||
vet:
|
vet:
|
||||||
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
|
|
||||||
go get golang.org/x/tools/cmd/vet; \
|
|
||||||
fi
|
|
||||||
@go list -f '{{.Dir}}' ./... \
|
@go list -f '{{.Dir}}' ./... \
|
||||||
| grep -v '.*github.com/hashicorp/vault$$' \
|
| grep -v '.*github.com/hashicorp/vault$$' \
|
||||||
| xargs go tool vet ; if [ $$? -eq 1 ]; then \
|
| xargs go tool vet ; if [ $$? -eq 1 ]; then \
|
||||||
@@ -53,4 +52,11 @@ vet:
|
|||||||
generate:
|
generate:
|
||||||
go generate ./...
|
go generate ./...
|
||||||
|
|
||||||
.PHONY: bin default generate test vet
|
# bootstrap the build by downloading additional tools
|
||||||
|
bootstrap:
|
||||||
|
@for tool in $(EXTERNAL_TOOLS) ; do \
|
||||||
|
echo "Installing $$tool" ; \
|
||||||
|
go get $$tool; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: bin default generate test vet bootstrap
|
||||||
|
|||||||
@@ -57,13 +57,12 @@ you'll first need [Go](https://www.golang.org) installed on your
|
|||||||
machine (version 1.4+ is *required*).
|
machine (version 1.4+ is *required*).
|
||||||
|
|
||||||
For local dev first make sure Go is properly installed, including setting up a
|
For local dev first make sure Go is properly installed, including setting up a
|
||||||
[GOPATH](https://golang.org/doc/code.html#GOPATH). After setting up Go,
|
[GOPATH](https://golang.org/doc/code.html#GOPATH). After setting up Go, you can
|
||||||
install Godeps, a tool we use for vendoring dependencies and Gox, a simple cross
|
downlaod the required build tools such as vet, cover, godep etc by bootstrapping
|
||||||
compilation tool:
|
your environment.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ go get github.com/tools/godep
|
$ make bootstrap
|
||||||
$ go get github.com/mitchellh/gox
|
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user