summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfotanus@gmail.com <Felipe Tanus>2015-05-14 07:00:52 -0300
committerfotanus@gmail.com <Felipe Tanus>2015-05-14 07:00:52 -0300
commit54e416fd45fc47c10c46a20092af51b65e8eda3d (patch)
tree8fae0aed4f563b023d469547446ec6a872242634 /lib
parent654e44a1febe1ebc89a43bb986a21f4efa653c6c (diff)
downloadbundler-54e416fd45fc47c10c46a20092af51b65e8eda3d.tar.gz
Distinguish CI command runs
This patch add CI information on the user_agent in order for us to track if a given command was run by a CI, as discussed in #3233.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/fetcher.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 42c6eb6717..936f28331f 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -155,6 +155,8 @@ module Bundler
agent << " options/#{Bundler.settings.all.join(",")}"
+ agent << " ci/#{cis.join(",")}" if cis.any?
+
# add a random ID so we can consolidate runs server-side
agent << " " << SecureRandom.hex(8)
@@ -178,6 +180,21 @@ module Bundler
FETCHERS = [Dependency, Index]
+ def cis
+ env_cis = {
+ "TRAVIS" => "travis",
+ "CIRCLECI" => "circle",
+ "SEMAPHORE" => "semaphore",
+ "JENKINS_URL" => "jenkins",
+ "BUILDBOX" => "buildbox",
+ "GO_SERVER_URL" => "go",
+ "SNAP_CI" => "snap",
+ "CI_NAME" => ENV["CI_NAME"],
+ "CI" => "ci"
+ }
+ env_cis.find_all{ |env, ci| ENV[env]}.map{ |env, ci| ci }
+ end
+
def connection
@connection ||= begin
needs_ssl = remote_uri.scheme == "https" ||