Merge pull request #1296 from srenatus/sr/nuke-check-go-version
scripts,Makefile: nuke check-go-version
This commit is contained in:
commit
1260c62a80
2 changed files with 3 additions and 40 deletions
10
Makefile
10
Makefile
|
@ -19,13 +19,13 @@ LD_FLAGS="-w -X $(REPO_PATH)/version.Version=$(VERSION)"
|
||||||
|
|
||||||
build: bin/dex bin/example-app bin/grpc-client
|
build: bin/dex bin/example-app bin/grpc-client
|
||||||
|
|
||||||
bin/dex: check-go-version
|
bin/dex:
|
||||||
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex
|
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex
|
||||||
|
|
||||||
bin/example-app: check-go-version
|
bin/example-app:
|
||||||
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/example-app
|
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/example-app
|
||||||
|
|
||||||
bin/grpc-client: check-go-version
|
bin/grpc-client:
|
||||||
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/grpc-client
|
@go install -v -ldflags $(LD_FLAGS) $(REPO_PATH)/examples/grpc-client
|
||||||
|
|
||||||
.PHONY: release-binary
|
.PHONY: release-binary
|
||||||
|
@ -75,10 +75,6 @@ bin/protoc: scripts/get-protoc
|
||||||
bin/protoc-gen-go:
|
bin/protoc-gen-go:
|
||||||
@go install -v $(REPO_PATH)/vendor/github.com/golang/protobuf/protoc-gen-go
|
@go install -v $(REPO_PATH)/vendor/github.com/golang/protobuf/protoc-gen-go
|
||||||
|
|
||||||
.PHONY: check-go-version
|
|
||||||
check-go-version:
|
|
||||||
@./scripts/check-go-version
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf bin/
|
@rm -rf bin/
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
VERSION=$( go version )
|
|
||||||
|
|
||||||
# For development versions of Go, these will be empty.
|
|
||||||
MAJOR_GOVERSION=$( echo -n "$VERSION" | grep -o 'go1\.[0-9]*' || true )
|
|
||||||
FULL_GOVERSION=$( echo -n "$VERSION" | grep -o 'go1\.[0-9|\.]*' || true )
|
|
||||||
|
|
||||||
# The list of unsupported major go versions.
|
|
||||||
UNSUPPORTED=( "go1.0" "go1.1" "go1.2" "go1.3" "go1.4" "go1.5" "go1.6" "go1.7" )
|
|
||||||
|
|
||||||
# Minor go versions which have known security vulnerabilities. Refuse to build with these.
|
|
||||||
#
|
|
||||||
# There aren't any security issues that impact dex in current Go versions but minor versions
|
|
||||||
# should be added here later if they do have issues.
|
|
||||||
KNOWN_INSECURE=( )
|
|
||||||
|
|
||||||
for V in "${UNSUPPORTED[@]}"; do
|
|
||||||
if [ "$V" = "$MAJOR_GOVERSION" ]; then
|
|
||||||
>&2 echo "ERROR: dex requires Go version 1.8+. Please update your Go installation: https://golang.org/dl/"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for V in "${KNOWN_INSECURE[@]}"; do
|
|
||||||
if [ "$V" = "$FULL_GOVERSION" ]; then
|
|
||||||
>&2 echo "Go version ${V} has known security vulnerabilities which impact dex. Please update your Go version."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
Reference in a new issue