jenkins_api_client 1.0.0.beta.1 → 1.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Vagrantfile +0 -3
- data/jenkins_api_client.gemspec +2 -2
- data/lib/jenkins_api_client/client.rb +20 -38
- data/lib/jenkins_api_client/job.rb +2 -2
- data/lib/jenkins_api_client/version.rb +1 -1
- metadata +2 -2
data/Vagrantfile
CHANGED
@@ -52,9 +52,6 @@ Vagrant.configure("2") do |config|
|
|
52
52
|
# View the documentation for the provider you're using for more
|
53
53
|
# information on available options.
|
54
54
|
|
55
|
-
config.ssh.max_tries = 40
|
56
|
-
config.ssh.timeout = 120
|
57
|
-
|
58
55
|
# The path to the Berksfile to use with Vagrant Berkshelf
|
59
56
|
# config.berkshelf.berksfile_path = "./Berksfile"
|
60
57
|
|
data/jenkins_api_client.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "jenkins_api_client"
|
8
|
-
s.version = "1.0.0.beta.
|
8
|
+
s.version = "1.0.0.beta.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kannan Manickam"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-12-18"
|
13
13
|
s.description = "\nThis is a simple and easy-to-use Jenkins Api client with features focused on\nautomating Job configuration programaticaly and so forth"
|
14
14
|
s.email = ["arangamani.kannan@gmail.com"]
|
15
15
|
s.executables = ["jenkinscli"]
|
@@ -67,44 +67,26 @@ module JenkinsApi
|
|
67
67
|
#
|
68
68
|
# @param args [Hash] Arguments to connect to Jenkins server
|
69
69
|
#
|
70
|
-
# @option args [String] :server_ip
|
71
|
-
#
|
72
|
-
# @option args [String] :
|
73
|
-
#
|
74
|
-
# @option args [String] :
|
75
|
-
#
|
76
|
-
# @option args [String] :username
|
77
|
-
# the username used for connecting to the server (optional)
|
78
|
-
# @option args [String] :password
|
79
|
-
# the password for connecting to the CI server (optional)
|
80
|
-
# @option args [String] :password_base64
|
81
|
-
# the password with base64 encoded format for connecting to the CI
|
70
|
+
# @option args [String] :server_ip the IP address of the Jenkins CI server
|
71
|
+
# @option args [String] :server_port the port on which the Jenkins listens
|
72
|
+
# @option args [String] :server_url the full URL address of the Jenkins CI server (http/https)
|
73
|
+
# @option args [String] :username the username used for connecting to the server (optional)
|
74
|
+
# @option args [String] :password the password or API Key for connecting to the CI server (optional)
|
75
|
+
# @option args [String] :password_base64 the password with base64 encoded format for connecting to the CI
|
82
76
|
# server (optional)
|
83
|
-
# @option args [String] :identity_file
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
# @option args [String] :
|
89
|
-
#
|
90
|
-
# @option args [
|
91
|
-
# the proxy port
|
92
|
-
# @option args [String] :jenkins_path ("/")
|
93
|
-
# the optional context path for Jenkins
|
94
|
-
# @option args [Boolean] :ssl (false)
|
95
|
-
# indicates if Jenkins is accessible over HTTPS
|
96
|
-
# @option args [Boolean] :follow_redirects
|
97
|
-
# This argument causes the client to follow a redirect (jenkins can
|
77
|
+
# @option args [String] :identity_file the priviate key file for Jenkins CLI authentication,
|
78
|
+
# it is used only for executing CLI commands. Also remember to upload the public key to
|
79
|
+
# <Server IP>:<Server Port>/user/<Username>/configure
|
80
|
+
# @option args [String] :proxy_ip the proxy IP address
|
81
|
+
# @option args [String] :proxy_port the proxy port
|
82
|
+
# @option args [String] :jenkins_path ("/") the optional context path for Jenkins
|
83
|
+
# @option args [Boolean] :ssl (false) indicates if Jenkins is accessible over HTTPS
|
84
|
+
# @option args [Boolean] :follow_redirects this argument causes the client to follow a redirect (jenkins can
|
98
85
|
# return a 30x when starting a build)
|
99
|
-
# @option args [Fixnum] :timeout (120)
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
# The location for the log file
|
104
|
-
# @option args [Fixnum] :log_level (Logger::INFO)
|
105
|
-
# The level for messages to be logged. Should be one of:
|
106
|
-
# Logger::DEBUG (0), Logger::INFO (1), Logger::WARN (2), Logger::ERROR
|
107
|
-
# (2), Logger::FATAL (3) (Defaults to Logger::INFO)
|
86
|
+
# @option args [Fixnum] :timeout (120) This argument sets the timeout for operations that take longer (in seconds)
|
87
|
+
# @option args [String] :log_location (STDOUT) the location for the log file
|
88
|
+
# @option args [Fixnum] :log_level (Logger::INFO) The level for messages to be logged. Should be one of:
|
89
|
+
# Logger::DEBUG (0), Logger::INFO (1), Logger::WARN (2), Logger::ERROR (2), Logger::FATAL (3)
|
108
90
|
#
|
109
91
|
# @return [JenkinsApi::Client] a client object to Jenkins API
|
110
92
|
#
|
@@ -315,7 +297,7 @@ module JenkinsApi
|
|
315
297
|
# @param [Boolean] raw_response Return complete Response object instead of
|
316
298
|
# JSON body of response
|
317
299
|
#
|
318
|
-
# @return [String,
|
300
|
+
# @return [String, Hash] JSON response from Jenkins
|
319
301
|
#
|
320
302
|
def api_get_request(url_prefix, tree = nil, url_suffix ="/api/json",
|
321
303
|
raw_response = false)
|
@@ -660,7 +642,7 @@ module JenkinsApi
|
|
660
642
|
# @param [Boolean] send_json Boolean value used to determine whether to
|
661
643
|
# load the JSON or send the response as is.
|
662
644
|
#
|
663
|
-
# @return [String,
|
645
|
+
# @return [String, Hash] Response returned whether loaded JSON or raw
|
664
646
|
# string
|
665
647
|
#
|
666
648
|
# @raise [Exceptions::Unauthorized] When invalid credentials are
|
@@ -916,7 +916,7 @@ module JenkinsApi
|
|
916
916
|
# Jenkins will return 404's until the job starts
|
917
917
|
begin
|
918
918
|
get_build_details(job_name, expected_build_id)
|
919
|
-
completion_proc.call(
|
919
|
+
completion_proc.call(expected_build_id, false) if completion_proc
|
920
920
|
|
921
921
|
return expected_build_id
|
922
922
|
rescue JenkinsApi::Exceptions::NotFound => e
|
@@ -940,7 +940,7 @@ module JenkinsApi
|
|
940
940
|
rescue JenkinsApi::Exceptions::ApiException => e
|
941
941
|
completion_proc.call(nil, false) if completion_proc
|
942
942
|
# Jenkins Api threw an error at us
|
943
|
-
@logger.warn "Problem while waiting for '#{job_name}' build ##{
|
943
|
+
@logger.warn "Problem while waiting for '#{job_name}' build ##{expected_build_id} to start. #{e.class} #{e}"
|
944
944
|
raise
|
945
945
|
end
|
946
946
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta.
|
4
|
+
version: 1.0.0.beta.2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|