From c04bf395f33cec4113976955d858a09b2e781596 Mon Sep 17 00:00:00 2001 From: Jeffry Hesse Date: Tue, 16 Jan 2018 15:31:26 -0900 Subject: [PATCH 1/2] Add in dep --- lib/travis/build/script/go.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/travis/build/script/go.rb b/lib/travis/build/script/go.rb index ae630c7a98..e74ad46875 100644 --- a/lib/travis/build/script/go.rb +++ b/lib/travis/build/script/go.rb @@ -70,7 +70,7 @@ def install sh.echo 'Using Go 1.5 Vendoring, not checking for Godeps' end sh.else do - sh .if '-f Godeps/Godeps.json' do + sh.if '-f Godeps/Godeps.json' do sh.export 'GOPATH', '${TRAVIS_BUILD_DIR}/Godeps/_workspace:$GOPATH', retry: false sh.export 'PATH', '${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH', retry: false @@ -81,6 +81,10 @@ def install end end end + sh.elif '-f Gopkg.toml' do + fetch_dep + sh.cmd 'dep ensure', retry: true, timing: true, assert: true, echo: true + end end sh.if uses_make do @@ -196,6 +200,21 @@ def update_gimme sh.cmd %Q'gimme #{DEFAULTS[:go]} &>/dev/null' end + def fetch_dep + dep = "$HOME/gopath/bin/dep" + + sh.mkdir "$HOME/gopath/bin", echo: false, recursive: true + + sh.if "$TRAVIS_OS_NAME = osx" do + sh.cmd "curl -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-darwin-amd64", echo: false + end + sh.elif "$TRAVIS_OS_NAME = linux" do + sh.cmd "curl -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64", echo: false + end + + sh.cmd "chmod +x #{dep}" + end + def fetch_godep godep = "$HOME/gopath/bin/godep" From 659dec588a5bb68fcd6c2a55b3315ad708f13687 Mon Sep 17 00:00:00 2001 From: Jeffry Hesse Date: Tue, 16 Jan 2018 15:45:02 -0900 Subject: [PATCH 2/2] -sL --- lib/travis/build/script/go.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/travis/build/script/go.rb b/lib/travis/build/script/go.rb index e74ad46875..bbe0917d76 100644 --- a/lib/travis/build/script/go.rb +++ b/lib/travis/build/script/go.rb @@ -206,10 +206,10 @@ def fetch_dep sh.mkdir "$HOME/gopath/bin", echo: false, recursive: true sh.if "$TRAVIS_OS_NAME = osx" do - sh.cmd "curl -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-darwin-amd64", echo: false + sh.cmd "curl -sL -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-darwin-amd64", echo: false end sh.elif "$TRAVIS_OS_NAME = linux" do - sh.cmd "curl -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64", echo: false + sh.cmd "curl -sL -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64", echo: false end sh.cmd "chmod +x #{dep}"