build: switch to 'go install' over 'go get' (#11582)

Also add lint-consul-retry to the 'make tools' set.
This commit is contained in:
R.B. Boyer 2021-11-16 12:04:49 -06:00 committed by GitHub
parent 1e02460bd1
commit 9db6645352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View File

@ -113,7 +113,7 @@ jobs:
- image: *GOLANG_IMAGE - image: *GOLANG_IMAGE
steps: steps:
- checkout - checkout
- run: go get -u github.com/hashicorp/lint-consul-retry && lint-consul-retry - run: go install github.com/hashicorp/lint-consul-retry@master && lint-consul-retry
- run: *notify-slack-failure - run: *notify-slack-failure
lint: lint:
@ -184,9 +184,8 @@ jobs:
name: Install gogo/protobuf name: Install gogo/protobuf
command: | command: |
gogo_version=$(go list -m github.com/gogo/protobuf | awk '{print $2}') gogo_version=$(go list -m github.com/gogo/protobuf | awk '{print $2}')
mkdir -p .gotools; cd .gotools; go mod init consul-tools go install -v github.com/hashicorp/protoc-gen-go-binary@master
go get -v github.com/hashicorp/protoc-gen-go-binary go install -v github.com/gogo/protobuf/protoc-gen-gofast@${gogo_version}
go get -v github.com/gogo/protobuf/protoc-gen-gofast@${gogo_version}
- run: - run:
command: make --always-make proto command: make --always-make proto

View File

@ -3,12 +3,13 @@ GOGOVERSION?=$(shell grep github.com/gogo/protobuf go.mod | awk '{print $$2}')
GOTOOLS = \ GOTOOLS = \
github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs@master \ github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs@master \
github.com/hashicorp/go-bindata/go-bindata@master \ github.com/hashicorp/go-bindata/go-bindata@master \
golang.org/x/tools/cmd/cover \ golang.org/x/tools/cmd/cover@master \
golang.org/x/tools/cmd/stringer \ golang.org/x/tools/cmd/stringer@master \
github.com/gogo/protobuf/protoc-gen-gofast@$(GOGOVERSION) \ github.com/gogo/protobuf/protoc-gen-gofast@$(GOGOVERSION) \
github.com/hashicorp/protoc-gen-go-binary \ github.com/hashicorp/protoc-gen-go-binary@master \
github.com/vektra/mockery/cmd/mockery \ github.com/vektra/mockery/cmd/mockery@master \
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1 github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40.1 \
github.com/hashicorp/lint-consul-retry@master
GOTAGS ?= GOTAGS ?=
GOOS?=$(shell go env GOOS) GOOS?=$(shell go env GOOS)
@ -283,12 +284,10 @@ static-assets:
ui: ui-docker static-assets-docker ui: ui-docker static-assets-docker
tools: tools:
@mkdir -p .gotools @if [[ -d .gotools ]]; then rm -rf .gotools ; fi
@cd .gotools && for TOOL in $(GOTOOLS); do \ @for TOOL in $(GOTOOLS); do \
echo "=== TOOL: $$TOOL" ; \ echo "=== TOOL: $$TOOL" ; \
rm -f go.mod go.sum ; \ go install -v $$TOOL ; \
go mod init consul-tools ; \
go get -v $$TOOL ; \
done done
version: version: