jenkins_pipeline_builder 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/README.md +1 -0
- data/lib/jenkins_pipeline_builder/cli/describe.rb +0 -2
- data/lib/jenkins_pipeline_builder/extensions/job_attributes.rb +23 -0
- data/lib/jenkins_pipeline_builder/extensions/publishers.rb +26 -0
- data/lib/jenkins_pipeline_builder/version.rb +1 -1
- data/spec/lib/jenkins_pipeline_builder/extensions/publishers_spec.rb +27 -0
- data/spec/lib/jenkins_pipeline_builder/extensions/registered_spec.rb +2 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 699fc75c52077b21b3605886db6c2f86875d0f3450b47cd328d65b1b03f17a8e
|
4
|
+
data.tar.gz: d3b3f3297bf7db62ba36b54f135c10d8b89b0944356c7fce8f7c2ea0a2c95db5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf713e4afde2e501a4d799232424f58e14b87cfeb139da16ad8590c1e964b3af59143aa4e5acd473481f587fbc54ac49a17bc613a45813ed8479d2778efed34
|
7
|
+
data.tar.gz: 882c2a069fdbb8dcb102237b23c6eb211bdffec37c86b9bbd88c99cd692888ddc1c30459a2bfb60b1217c16ac80b31e81abbc876a006ea9d47aa2e74db88579b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -247,6 +247,7 @@ A number of the DSL options rely on Jenkins plugins, including:
|
|
247
247
|
* ansicolor - "AnsiColor"
|
248
248
|
* (view) type: 'categorizedView' - "categorized-view"
|
249
249
|
* hipchat - "HipChat Plugin"
|
250
|
+
* google_chat - "google-chat-notification-plugin"
|
250
251
|
* inject_env_vars - "Environment Injector Plugin"
|
251
252
|
* priority - "Priority Sorter plugin"
|
252
253
|
* downstream - "Parameterized Trigger plugin"
|
@@ -26,7 +26,6 @@ module JenkinsPipelineBuilder
|
|
26
26
|
entries << :job_attributes
|
27
27
|
entries.try(:each) do |entry|
|
28
28
|
klass_name = entry.to_s.classify
|
29
|
-
# rubocop:disable Style/AccessModifierIndentation
|
30
29
|
klass = Class.new(Thor) do
|
31
30
|
extensions = if entry == :job_attributes
|
32
31
|
JenkinsPipelineBuilder.registry.registry[:job].select { |_, x| x.is_a? ExtensionSet }
|
@@ -49,7 +48,6 @@ module JenkinsPipelineBuilder
|
|
49
48
|
puts "#{ext.name}: #{ext.description}"
|
50
49
|
end
|
51
50
|
end
|
52
|
-
# rubocop:enable Style/AccessModifierIndentation
|
53
51
|
Module.const_set(klass_name, klass)
|
54
52
|
end
|
55
53
|
|
@@ -265,6 +265,29 @@ job_attribute do
|
|
265
265
|
end
|
266
266
|
end
|
267
267
|
|
268
|
+
job_attribute do
|
269
|
+
name :google_chat
|
270
|
+
plugin_id 'google-chat-notification'
|
271
|
+
description 'This plugin allows your team to setup build notifications to be sent to Google Chat rooms.'
|
272
|
+
jenkins_name 'Google Chat Notification'
|
273
|
+
announced false
|
274
|
+
|
275
|
+
xml path: '//properties' do |params|
|
276
|
+
send('io.cnaik.GoogleChatNotification', 'plugin' => 'google-chat-notification') do
|
277
|
+
url params[:url] || ''
|
278
|
+
notifyAborted params[:notifyAborted] || false
|
279
|
+
notifyFailure params[:notifyFailure] || false
|
280
|
+
notifyNotBuilt params[:notifyNotBuilt] || false
|
281
|
+
notifySuccess params[:notifySuccess] || false
|
282
|
+
notifyUnstable params[:notifyUnstable] || false
|
283
|
+
notifyBackToNormal params[:notifyBackToNormal] || false
|
284
|
+
suppressInfoLoggers params[:suppressInfoLoggers] || false
|
285
|
+
sameThreadNotification params[:sameThreadNotification] || false
|
286
|
+
message params[:message] || ''
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
268
291
|
job_attribute do
|
269
292
|
name :hipchat
|
270
293
|
plugin_id 'hipchat'
|
@@ -72,6 +72,32 @@ publisher do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
publisher do
|
76
|
+
name :google_chat
|
77
|
+
plugin_id 'google-chat-notification'
|
78
|
+
description 'This plugin allows your team to setup build notifications to be sent to Google Chat rooms.'
|
79
|
+
jenkins_name 'Google Chat Notification'
|
80
|
+
announced false
|
81
|
+
|
82
|
+
version '0' do
|
83
|
+
xml do |params|
|
84
|
+
params = {} if params == true
|
85
|
+
send('io.cnaik.GoogleChatNotification') do
|
86
|
+
url params[:url] || ''
|
87
|
+
message params[:message] || ''
|
88
|
+
notifyAborted params[:notifyAborted] || false
|
89
|
+
notifyFailure params[:notifyFailure] || false
|
90
|
+
notifyNotBuilt params[:notifyNotBuilt] || false
|
91
|
+
notifySuccess params[:notifySuccess] || false
|
92
|
+
notifyUnstable params[:notifyUnstable] || false
|
93
|
+
notifyBackToNormal params[:notifyBackToNormal] || false
|
94
|
+
suppressInfoLoggers params[:suppressInfoLoggers] || false
|
95
|
+
sameThreadNotification params[:sameThreadNotification] || false
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
75
101
|
publisher do
|
76
102
|
name :hipchat
|
77
103
|
plugin_id 'hipchat'
|
@@ -427,6 +427,33 @@ describe 'publishers' do
|
|
427
427
|
end
|
428
428
|
end
|
429
429
|
|
430
|
+
context 'google_chat' do
|
431
|
+
before :each do
|
432
|
+
allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
|
433
|
+
list_installed: { 'google-chat-notification' => '0' }
|
434
|
+
)
|
435
|
+
end
|
436
|
+
it 'generates a configuration' do
|
437
|
+
params = { publishers: { google_chat: {} } }
|
438
|
+
|
439
|
+
JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
|
440
|
+
|
441
|
+
publisher = @n_xml.root.children.first
|
442
|
+
expect(publisher.name).to match 'io.cnaik.GoogleChatNotification'
|
443
|
+
children = publisher.children.map(&:name)
|
444
|
+
expect(children).to include 'url'
|
445
|
+
expect(children).to include 'message'
|
446
|
+
expect(children).to include 'notifyAborted'
|
447
|
+
expect(children).to include 'notifyFailure'
|
448
|
+
expect(children).to include 'notifyNotBuilt'
|
449
|
+
expect(children).to include 'notifySuccess'
|
450
|
+
expect(children).to include 'notifyUnstable'
|
451
|
+
expect(children).to include 'notifyBackToNormal'
|
452
|
+
expect(children).to include 'suppressInfoLoggers'
|
453
|
+
expect(children).to include 'sameThreadNotification'
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
430
457
|
context 'coverage_result' do
|
431
458
|
it 'generates a configuration'
|
432
459
|
end
|
@@ -27,6 +27,7 @@ PUBLISHERS = {
|
|
27
27
|
git: ['0'],
|
28
28
|
github_pr_coverage_status_reporter: ['0'],
|
29
29
|
groovy_postbuild: ['0'],
|
30
|
+
google_chat: ['0'],
|
30
31
|
hipchat: ['0', '0.1.9', '2.0.0'],
|
31
32
|
html_publisher: ['0'],
|
32
33
|
junit_result: ['0'],
|
@@ -69,6 +70,7 @@ JOB_ATTRIBUTES = {
|
|
69
70
|
hipchat: ['0', '2.0.0'],
|
70
71
|
inject_env_vars_pre_scm: ['0'],
|
71
72
|
parameters: ['0'],
|
73
|
+
google_chat: ['0'],
|
72
74
|
shared_workspace: ['0'],
|
73
75
|
prepare_environment: ['0'],
|
74
76
|
priority: ['0'],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins_pipeline_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Moochnick
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -483,8 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
483
483
|
- !ruby/object:Gem::Version
|
484
484
|
version: '0'
|
485
485
|
requirements: []
|
486
|
-
|
487
|
-
rubygems_version: 2.7.7
|
486
|
+
rubygems_version: 3.0.2
|
488
487
|
signing_key:
|
489
488
|
specification_version: 4
|
490
489
|
summary: This gem is will boostrap your Jenkins pipelines
|