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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a89e7eaacca4711e8cfba8ba745799d5b4eb01014a5a78740ff74ab606595f7a
4
- data.tar.gz: d9adb6f45f1d7be7ea7c1815e491338ad32bfc7b15859c92955482d550930332
3
+ metadata.gz: 699fc75c52077b21b3605886db6c2f86875d0f3450b47cd328d65b1b03f17a8e
4
+ data.tar.gz: d3b3f3297bf7db62ba36b54f135c10d8b89b0944356c7fce8f7c2ea0a2c95db5
5
5
  SHA512:
6
- metadata.gz: 19c78e7c9801ce59933cd96b37cf259d76d0b9c0e427b2c6dcd3b40491d7e77efb6c22dd09f384cb1221ba062e3bc614bb9ecd4f2c7920f028bed18f7ced6079
7
- data.tar.gz: 2fd655ec2dd99d45ddc6f2f794cf6b6b7ecf469f8b8eb4fe22aeb74f5f9791f42b06e5ffb37087e2d9bda7cb35c512e17915ebbe78055984299c97d235870025
6
+ metadata.gz: 1bf713e4afde2e501a4d799232424f58e14b87cfeb139da16ad8590c1e964b3af59143aa4e5acd473481f587fbc54ac49a17bc613a45813ed8479d2778efed34
7
+ data.tar.gz: 882c2a069fdbb8dcb102237b23c6eb211bdffec37c86b9bbd88c99cd692888ddc1c30459a2bfb60b1217c16ac80b31e81abbc876a006ea9d47aa2e74db88579b
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.5
4
3
  - 2.3.3
5
4
  before_install:
6
5
  - gem install bundler
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'
@@ -21,5 +21,5 @@
21
21
  #
22
22
 
23
23
  module JenkinsPipelineBuilder
24
- VERSION = '1.8.0'.freeze
24
+ VERSION = '1.9.0'.freeze
25
25
  end
@@ -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.8.0
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: 2018-10-17 00:00:00.000000000 Z
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
- rubyforge_project:
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