From 4a830ddcc3394c4fcb4cb2a062e207a8d578a0ac Mon Sep 17 00:00:00 2001 From: Eric Chiang Date: Wed, 9 Mar 2016 13:05:48 -0800 Subject: [PATCH] *: move build scripts to use GO15VENDOREXPERIMENT closes #328 --- .travis.yml | 1 - Dockerfile-builder | 4 ++-- env | 15 +++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c63dd8b1..fa6fdb58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ services: language: go go: - - 1.4.3 - 1.5.3 - 1.6 diff --git a/Dockerfile-builder b/Dockerfile-builder index 8da5fc06..3ca1303c 100644 --- a/Dockerfile-builder +++ b/Dockerfile-builder @@ -1,5 +1,5 @@ -FROM golang:1.4 +FROM golang:1.6 RUN go get golang.org/x/tools/cmd/cover RUN go get golang.org/x/tools/cmd/vet -RUN go get github.com/tools/godep \ No newline at end of file +RUN go get github.com/tools/godep diff --git a/env b/env index bbf981c8..905b7629 100644 --- a/env +++ b/env @@ -1,11 +1,14 @@ -export GOPATH=${PWD}/Godeps/_workspace +GOVERSION=$( go version | grep -o 'go1\.[0-9]') -rm -rf $GOPATH/src/github.com/coreos/dex -mkdir -p $GOPATH/src/github.com/coreos/ +UNSUPPORTED=( "go1.0" "go1.1" "go1.2" "go1.3" "go1.4" ) -# Only attempt to link dex into godeps if it isn't already there -[ -d $GOPATH/src/github.com/coreos/dex ] || ln -s ${PWD} $GOPATH/src/github.com/coreos/dex +for V in "${UNSUPPORTED[@]}"; do + if [ "$V" = "$GOVERSION" ]; then + echo "dex requires go version 1.5+. Please update your go version." + exit 2 + fi +done +export GO15VENDOREXPERIMENT=1 export VERSION=$(./git-version) - LD_FLAGS="-X main.version=${VERSION}"