Class: Fastlane::Helper::UpdateJenkinsBuildHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/update_jenkins_build/helper/update_jenkins_build_helper.rb

Class Method Summary collapse

Class Method Details

.jenkins_version(url, user, password) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fastlane/plugin/update_jenkins_build/helper/update_jenkins_build_helper.rb', line 9

def self.jenkins_version(url, user, password)
  url = "#{url}/api/json"
  res = if user && password
          HTTP.basic_auth(user: user, pass: password)
              .get(url)
        else
          HTTP.get(url)
        end

  res.headers['X-Jenkins']
end