jenkins2-api 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/client.rb +3 -2
- data/lib/endpoints/build.rb +1 -1
- data/lib/endpoints/job.rb +10 -0
- data/lib/version.rb +1 -1
- metadata +17 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b8f8387235bc79d14b363e9112d548612e6de47619d30206a5613435dc8c7854
|
4
|
+
data.tar.gz: 0f6312936b46c1f9d1cfbb17adb43f81e2aa0ec01727a25388927aae3c901f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30ec4147422b79b321f57e2ba4df7fda87ffc07c037b582435258b6d4ee67416002081e1345218fead43cda6e4715a3fd56d89a18fe457d6b2c018f89e4848db
|
7
|
+
data.tar.gz: adf0e7b3c6dbd226749ef7bc50dea960b2863164b179d86edfeed10ff83ccd158e6d3a825d49943780f70fe2540116b1b2fff4c2ba588495052bf2d1ad1aa1dc
|
data/lib/client.rb
CHANGED
@@ -64,7 +64,7 @@ module Jenkins2API
|
|
64
64
|
# ==== Params:
|
65
65
|
# +method+:: +:post+ or +:get+
|
66
66
|
# +path+:: Path to the Jenkins resource (e.g.: +/job/my-job/+)
|
67
|
-
# +response_type+:: +:json+ or +:raw+
|
67
|
+
# +response_type+:: +:json+, +:xml+ or +:raw+
|
68
68
|
# +opts+:: sym options to pass to the endpoint. Applicable only if +:post+
|
69
69
|
def api_request(method, path, response_type = :json, **opts)
|
70
70
|
req = new_request(method, path, response_type, opts)
|
@@ -85,10 +85,11 @@ module Jenkins2API
|
|
85
85
|
# Creates a new request for the API call
|
86
86
|
# with default and required values
|
87
87
|
def new_request(method, path, response_type, **opts)
|
88
|
-
response_type = :json unless %i[json raw].include?(response_type)
|
88
|
+
response_type = :json unless %i[json raw xml].include?(response_type)
|
89
89
|
|
90
90
|
parts = [@server, URI.escape(path)]
|
91
91
|
parts << 'api/json' if response_type == :json
|
92
|
+
parts << 'api/xml' if response_type == :xml
|
92
93
|
uri = URI(File.join(parts))
|
93
94
|
uri.query = URI.encode_www_form(opts)
|
94
95
|
|
data/lib/endpoints/build.rb
CHANGED
@@ -28,7 +28,7 @@ module Jenkins2API
|
|
28
28
|
# +name+:: Name of the Job
|
29
29
|
# +build_id+:: ID of the build
|
30
30
|
def test_results(name, build_id)
|
31
|
-
@client.api_request(:get, "/job/#{name}/#{build_id}/testReport")
|
31
|
+
@client.api_request(:get, "/job/#{name}/#{build_id}/testReport", :xml)
|
32
32
|
end
|
33
33
|
|
34
34
|
# Get +console log+ for a specific build as text
|
data/lib/endpoints/job.rb
CHANGED
@@ -31,6 +31,16 @@ module Jenkins2API
|
|
31
31
|
@client.api_request(:get, "/job/#{name}")['builds']
|
32
32
|
end
|
33
33
|
|
34
|
+
# Get all available sub-jobs for a specific job
|
35
|
+
#
|
36
|
+
# ==== Params:
|
37
|
+
# +name+:: Name of the Job
|
38
|
+
#
|
39
|
+
# Returns with an array of jobs
|
40
|
+
def jobs(name)
|
41
|
+
@client.api_request(:get, "/job/#{name}")['jobs']
|
42
|
+
end
|
43
|
+
|
34
44
|
# Trigger a build on a specific job
|
35
45
|
#
|
36
46
|
# ==== Params:
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins2-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Balazs Nadasdi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12'
|
31
34
|
- - ">="
|
32
35
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
36
|
+
version: 12.3.3
|
34
37
|
type: :development
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '12'
|
38
44
|
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
46
|
+
version: 12.3.3
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rdoc
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,7 +150,7 @@ homepage: https://yitsushi.github.io/jenkins2-api/
|
|
144
150
|
licenses:
|
145
151
|
- MIT
|
146
152
|
metadata: {}
|
147
|
-
post_install_message:
|
153
|
+
post_install_message:
|
148
154
|
rdoc_options: []
|
149
155
|
require_paths:
|
150
156
|
- lib
|
@@ -159,16 +165,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
165
|
- !ruby/object:Gem::Version
|
160
166
|
version: '0'
|
161
167
|
requirements: []
|
162
|
-
|
163
|
-
|
164
|
-
signing_key:
|
168
|
+
rubygems_version: 3.0.1
|
169
|
+
signing_key:
|
165
170
|
specification_version: 4
|
166
171
|
summary: API client for Jenkins 2.
|
167
172
|
test_files:
|
168
|
-
- spec/
|
173
|
+
- spec/spec_helper.rb
|
169
174
|
- spec/features/client_spec.rb
|
170
175
|
- spec/features/job_spec.rb
|
171
|
-
- spec/
|
176
|
+
- spec/features/build_spec.rb
|
172
177
|
- spec/support/fake_jenkins.rb
|
173
|
-
- spec/support/fixtures/job_list.json
|
174
178
|
- spec/support/fixtures/latest_build.json
|
179
|
+
- spec/support/fixtures/job_list.json
|