Skip to content

Commit

Permalink
Merge pull request #499 from travis-ci/sol-atlas-go-get-fix
Browse files Browse the repository at this point in the history
Fixes issue with `go get atlas-upload-cli` not working
  • Loading branch information
BanzaiMan committed Aug 19, 2016
2 parents 2ca41d9 + 568f59e commit 424c7a6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lib/dpl/provider/atlas.rb
Expand Up @@ -16,14 +16,15 @@ class Atlas < Provider
chmod +x $HOME/bin/gimme
fi
export GOPATH="$HOME/gopath:$GOPATH"
eval "$(gimme 1.4.2)" &>/dev/null
if [ -z $GOPATH ]; then
export GOPATH="$HOME/gopath"
else
export GOPATH="$HOME/gopath:$GOPATH"
fi
eval "$(gimme 1.6)" &> /dev/null
go get #{ATLAS_UPLOAD_CLI_GO_REMOTE}
pushd $HOME/gopath/src/#{ATLAS_UPLOAD_CLI_GO_REMOTE} &>/dev/null
make &>/dev/null
cp bin/atlas-upload $HOME/bin/atlas-upload
popd &>/dev/null
cp $HOME/gopath/bin/atlas-upload-cli $HOME/bin/atlas-upload
fi
EOF

Expand Down Expand Up @@ -59,7 +60,9 @@ def push_app
private

def install_atlas_upload
context.shell ATLAS_UPLOAD_INSTALL_SCRIPT
without_git_http_user_agent do
context.shell ATLAS_UPLOAD_INSTALL_SCRIPT
end
end

def assert_app_present!
Expand Down Expand Up @@ -93,6 +96,13 @@ def atlas_upload_args
def atlas_app
@atlas_app ||= options.fetch(:app).to_s
end

def without_git_http_user_agent(&block)
git_http_user_agent = ENV.delete("GIT_HTTP_USER_AGENT")
yield
ENV["GIT_HTTP_USER_AGENT"] = git_http_user_agent
end

end
end
end

0 comments on commit 424c7a6

Please sign in to comment.