Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in Dep for Golang builds #1293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/travis/build/script/go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

end
end

sh.if uses_make do
Expand Down Expand Up @@ -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 -sL -o #{dep} https://github.com/golang/dep/releases/download/v0.3.2/dep-darwin-amd64", echo: false

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

end
sh.elif "$TRAVIS_OS_NAME = linux" do
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}"

This comment was marked as spam.

end

def fetch_godep
godep = "$HOME/gopath/bin/godep"

Expand Down