jenkins_pipeline_builder 1.4.0 → 1.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0015906b8d8d1be908004af6227116d2b2cf44f0
4
- data.tar.gz: 0c29e265ded1b244d5a3572ea1ec8eaa3dbab5ff
3
+ metadata.gz: 1c9eaa60f562aa024ee5a9b44bdb38a5449e9a41
4
+ data.tar.gz: a3e1a81c570cfa3fefa4d81aa5e03e6182a0073f
5
5
  SHA512:
6
- metadata.gz: 0c9f85580321286f501449bc5de9c41042838f33f60d0f570d2037b51c0bfaa7c51baaae60c5337324202b46076262566b8dc6f7984ee58797610564dfff4621
7
- data.tar.gz: e113a4d54514393cb96db1967524d329b585d2e265d0699e087dc6ea59cceb71acefc5a3fe795f142d5f88a857afc2eb35d2b97ea62390bc565a6f42442cfec4
6
+ metadata.gz: e19ef3c9750c89d0aa696a0c252faef6de04177e4c6288fafbd1339cab7a2ceeafd7764055ec25015c81f3afb8edffeeef1d794fe4d8f261c379b10b9d57781a
7
+ data.tar.gz: 564e2f4f913f581bb9ac35a5dd7d7874f823ad1051500664d2bc2d1d1cabc5313bfa3b3482a7b29da76f4ce8e06c600d3c7760ad19d4450ddbc0f529f42c941a
@@ -255,7 +255,7 @@ job_attribute do
255
255
  end
256
256
  end
257
257
  if params[:included_regions] || params[:excluded_regions]
258
- send('hudson.plugins.git.extensions.impl.PathRestrictions') do
258
+ send('hudson.plugins.git.extensions.impl.PathRestriction') do
259
259
  includedRegions params[:included_regions] if params[:included_regions]
260
260
  excludedRegions params[:excluded_regions] if params[:excluded_regions]
261
261
  end
@@ -108,6 +108,82 @@ publisher do
108
108
  end
109
109
  end
110
110
  end
111
+
112
+ version '2.0.0' do
113
+ xml do |params|
114
+ send('jenkins.plugins.hipchat.HipChatNotifier') do
115
+ credentialId params[:credential_id] || ''
116
+ room params[:room] || ''
117
+ send('notifications') do
118
+ if startNotification params[:start_notify]
119
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
120
+ notifyEnabled params[:enabled_notify] || false
121
+ textFormat params[:text_format] || false
122
+ notificationType params[:notification_type] || 'STARTED'
123
+ color params[:color] || ''
124
+ messageTemplate params[:message_template] || ''
125
+ end
126
+ end
127
+ if notifySuccess params[:success_notify]
128
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
129
+ notifyEnabled params[:enabled_notify] || false
130
+ textFormat params[:text_format] || false
131
+ notificationType params[:notification_type] || 'SUCCESS'
132
+ color params[:color] || ''
133
+ messageTemplate params[:message_template] || ''
134
+ end
135
+ end
136
+ if notifyFailure params[:failure_notify]
137
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
138
+ notifyEnabled params[:enabled_notify] || false
139
+ textFormat params[:text_format] || false
140
+ notificationType params[:notification_type] || 'FAILURE'
141
+ color params[:color] || ''
142
+ messageTemplate params[:message_template] || ''
143
+ end
144
+ end
145
+ if notifyBackToNormal params[:normal_notify]
146
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
147
+ notifyEnabled params[:enabled_notify] || false
148
+ textFormat params[:text_format] || false
149
+ notificationType params[:notification_type] || 'BACK_TO_NORMAL'
150
+ color params[:color] || ''
151
+ messageTemplate params[:message_template] || ''
152
+ end
153
+ end
154
+ if notifyAborted params[:aborted_notify]
155
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
156
+ notifyEnabled params[:enabled_notify] || false
157
+ textFormat params[:text_format] || false
158
+ notificationType params[:notification_type] || 'ABORTED'
159
+ color params[:color] || ''
160
+ messageTemplate params[:message_template] || ''
161
+ end
162
+ end
163
+ if notifyNotBuilt params[:notbuilt_notify]
164
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
165
+ notifyEnabled params[:enabled_notify] || false
166
+ textFormat params[:text_format] || false
167
+ notificationType params[:notification_type] || 'NOT_BUILT'
168
+ color params[:color] || ''
169
+ messageTemplate params[:message_template] || ''
170
+ end
171
+ end
172
+ if notifyUnstable params[:unstable_notify]
173
+ send('jenkins.plugins.hipchat.model.NotificationConfig') do
174
+ notifyEnabled params[:enabled_notify] || false
175
+ textFormat params[:text_format] || false
176
+ notificationType params[:notification_type] || 'UNSTABLE'
177
+ color params[:color] || ''
178
+ messageTemplate params[:message_template] || ''
179
+ end
180
+ end
181
+ end
182
+ startJobMessage params[:start_message] || ''
183
+ completeJobMessage params[:complete_message] || ''
184
+ end
185
+ end
186
+ end
111
187
  end
112
188
 
113
189
  publisher do
@@ -21,5 +21,5 @@
21
21
  #
22
22
 
23
23
  module JenkinsPipelineBuilder
24
- VERSION = '1.4.0'.freeze
24
+ VERSION = '1.5.0'.freeze
25
25
  end
@@ -326,6 +326,9 @@ describe 'job_attributes' do
326
326
  expect(
327
327
  scm_config.xpath('//scm/extensions/hudson.plugins.git.extensions.impl.WipeWorkspace').first
328
328
  ).to_not be_nil
329
+ expect(
330
+ scm_config.xpath('//scm/extensions/hudson.plugins.git.extensions.impl.PathRestriction').first
331
+ ).to_not be_nil
329
332
 
330
333
  expect(scm_config.css('compareRemote').first.content).to eq 'origin'
331
334
  expect(scm_config.css('compareTarget').first.content).to eq 'pr-1'
@@ -173,6 +173,43 @@ describe 'publishers' do
173
173
  end
174
174
 
175
175
  context 'hipchat' do
176
+ context '2.0.0' do
177
+ before :each do
178
+ allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
179
+ list_installed: { 'hipchat' => '2.0.0' }
180
+ )
181
+ end
182
+ it 'generates a configuration' do
183
+ params = { publishers: { hipchat: {} } }
184
+ hipchat = JenkinsPipelineBuilder.registry.registry[:job][:publishers][:hipchat]
185
+ expect(hipchat.extension.min_version).to eq '2.0.0'
186
+ JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
187
+
188
+ publisher = @n_xml.root.children.first
189
+ expect(publisher.name).to match 'jenkins.plugins.hipchat.HipChatNotifier'
190
+ children = publisher.children.map(&:name)
191
+ expect(children).to include 'credentialId'
192
+ expect(children).to include 'room'
193
+ expect(children).to include 'notifications'
194
+ expect(children).to include 'startJobMessage'
195
+ expect(children).to include 'completeJobMessage'
196
+ end
197
+
198
+ it 'instantiates notification parameters' do
199
+ params = { publishers: { hipchat: {} } }
200
+ JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
201
+
202
+ publisher = @n_xml.root.children.first
203
+ expect(publisher.name).to match 'jenkins.plugins.hipchat.HipChatNotifier'
204
+ children = publisher.children.children.children.map(&:name)
205
+ expect(children).to include 'notifyEnabled'
206
+ expect(children).to include 'textFormat'
207
+ expect(children).to include 'notificationType'
208
+ expect(children).to include 'color'
209
+ expect(children).to include 'messageTemplate'
210
+ end
211
+ end
212
+
176
213
  context '0.1.9' do
177
214
  before :each do
178
215
  allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
@@ -26,7 +26,7 @@ PUBLISHERS = {
26
26
  email_notifications: ['0'],
27
27
  git: ['0'],
28
28
  groovy_postbuild: ['0'],
29
- hipchat: ['0', '0.1.9'],
29
+ hipchat: ['0', '0.1.9', '2.0.0'],
30
30
  html_publisher: ['0'],
31
31
  junit_result: ['0'],
32
32
  performance_plugin: ['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.0
4
+ version: 1.5.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: 2017-09-01 00:00:00.000000000 Z
12
+ date: 2017-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -484,7 +484,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
484
484
  version: '0'
485
485
  requirements: []
486
486
  rubyforge_project:
487
- rubygems_version: 2.6.11
487
+ rubygems_version: 2.6.13
488
488
  signing_key:
489
489
  specification_version: 4
490
490
  summary: This gem is will boostrap your Jenkins pipelines