jenkins_pipeline_builder 0.12.2 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzM3ZDViODU1ODFjZTc4ODlkZmJjZGVjNzMzMjk3MWI1NDNmYmRkZQ==
5
- data.tar.gz: !binary |-
6
- OWFhYjQzMTgxZThlMjEyNDY1NTc1YzQxNjJmMWJhNTNhMWVhNDk1YQ==
2
+ SHA1:
3
+ metadata.gz: 7ff5911aaeb0f11a27eb6756740cd930be390326
4
+ data.tar.gz: 1930e2d5697efb6fa936d86a12be093d6e655c52
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTk0MWM1NDhmMzI3NWJmNjZiYzllNGJjNWI4ZTEyZTVjY2E5N2M4ZTJkMjNh
10
- ZTg2MWIyNDQ1YWMwMzY3NDI3MGYzMzY1YjUxMGYwMTdjMmQyNDlkYTZhNGZm
11
- NGZkNzJkYTc3MGE1OTJmODM1YTUxN2I5YWYzZmQxNDY1YjJiNGM=
12
- data.tar.gz: !binary |-
13
- M2I2ZjFmZTEzNjQ5ZDE5ZWU4MTkyZmZmMDRjYTIyNWVjNTU5YTVmOTUzNDcz
14
- MTQyNDBmNzU4MDUwNTE5OGZhNThkYTUyNmE3YTBiYjQ5YzMyODUxZDJjODgw
15
- ZGY4ZmZiM2MxY2Q2ZmJlMTQ2NjczYzIxZjI0ZTYzMTUwNzI1MzI=
6
+ metadata.gz: 46026f946c85e0e812aad13ff8a1c1ad3ab50ffb2f91c38eab688c6fc7256483e9cb842b84960c3112e5f6a7034c0a310fc3cce5a9764b775497d8827ad7d970
7
+ data.tar.gz: e4f39e5da1c25a11f38709706aaa5ea128e7e9c9edc14f452754303fdc8314ecfc9001cce23b9ebb1e1588425f52e0034b9f190b8ccd2a8cbc39f71613df2f63
@@ -1,4 +1,5 @@
1
1
  class ParametersHelper < ExtensionHelper
2
+ # rubocop:disable CyclomaticComplexity
2
3
  def param_type(param)
3
4
  case param[:type]
4
5
  when 'string'
@@ -11,8 +12,11 @@ class ParametersHelper < ExtensionHelper
11
12
  'hudson.model.PasswordParameterDefinition'
12
13
  when 'choice'
13
14
  'hudson.model.ChoiceParameterDefinition'
15
+ when 'file'
16
+ 'hudson.model.FileParameterDefinition'
14
17
  else
15
18
  'hudson.model.StringParameterDefinition'
16
19
  end
17
20
  end
21
+ # rubocop:enable CyclomaticComplexity
18
22
  end
@@ -309,7 +309,7 @@ publisher do
309
309
  branch params[:branch] || ''
310
310
  language
311
311
  mavenOpts
312
- jobAdditionalProperties
312
+ jobAdditionalProperties params[:additional_properties] || ''
313
313
  mavenInstallationName params[:maven_installation_name] || ''
314
314
  rootPom params[:root_pom] || ''
315
315
  settings class: 'jenkins.mvn.DefaultSettingsProvider'
@@ -21,5 +21,5 @@
21
21
  #
22
22
 
23
23
  module JenkinsPipelineBuilder
24
- VERSION = '0.12.2'
24
+ VERSION = '0.12.3'
25
25
  end
@@ -97,6 +97,13 @@ describe 'job_attributes' do
97
97
  end
98
98
  end
99
99
 
100
+ context 'file parameter' do
101
+ let(:type) { 'file' }
102
+ it 'generates correct config' do
103
+ expect(@parameters.to_s).to include 'hudson.model.FileParameterDefinition'
104
+ end
105
+ end
106
+
100
107
  context 'defaults to string' do
101
108
  let(:type) { 'bad_choice' }
102
109
  it 'generates correct config' do
@@ -31,13 +31,20 @@ describe 'publishers' do
31
31
  list_installed: { 'sonar' => '20.0' })
32
32
  end
33
33
 
34
- it 'generates a configuration' do
34
+ it 'generates a default configuration' do
35
35
  params = { publishers: { sonar_result: {} } }
36
36
 
37
37
  JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
38
38
 
39
39
  sonar_publisher = @n_xml.root.children.first
40
40
  expect(sonar_publisher.name).to match 'hudson.plugins.sonar.SonarPublisher'
41
+
42
+ sonar_nodes = @n_xml.root.children.first.children
43
+ jdk_value = sonar_nodes.select { |node| node.name == 'jdk' }
44
+ expect(jdk_value.first.content).to match '(Inherit From Job)'
45
+
46
+ additional_properties_value = sonar_nodes.select { |node| node.name == 'jobAdditionalProperties' }
47
+ expect(additional_properties_value.first.content).to match ''
41
48
  end
42
49
 
43
50
  it 'populates branch' do
@@ -70,24 +77,24 @@ describe 'publishers' do
70
77
  expect(root_pom.first.content).to match 'project_war/pom.xml'
71
78
  end
72
79
 
73
- it 'populates the jdk by with default' do
74
- params = { publishers: { sonar_result: {} } }
80
+ it 'populates the jdk by' do
81
+ params = { publishers: { sonar_result: { jdk: 'java8' } } }
75
82
 
76
83
  JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
77
84
 
78
85
  sonar_nodes = @n_xml.root.children.first.children
79
- root_pom = sonar_nodes.select { |node| node.name == 'jdk' }
80
- expect(root_pom.first.content).to match '(Inherit From Job)'
86
+ jdk_value = sonar_nodes.select { |node| node.name == 'jdk' }
87
+ expect(jdk_value.first.content).to match 'java8'
81
88
  end
82
89
 
83
- it 'populates the jdk by' do
84
- params = { publishers: { sonar_result: { jdk: 'java8' } } }
90
+ it 'populates the additional properties' do
91
+ params = { publishers: { sonar_result: { additional_properties: '-Dsonar.version=$APP_VERSION' } } }
85
92
 
86
93
  JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
87
94
 
88
95
  sonar_nodes = @n_xml.root.children.first.children
89
- root_pom = sonar_nodes.select { |node| node.name == 'jdk' }
90
- expect(root_pom.first.content).to match 'java8'
96
+ additional_properties_value = sonar_nodes.select { |node| node.name == 'jobAdditionalProperties' }
97
+ expect(additional_properties_value.first.content).to match '-Dsonar.version=$APP_VERSION'
91
98
  end
92
99
  end
93
100
 
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: 0.12.2
4
+ version: 0.12.3
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: 2015-06-29 00:00:00.000000000 Z
12
+ date: 2015-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -43,42 +43,42 @@ dependencies:
43
43
  name: thor
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: 0.18.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.18.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: activesupport
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ! '>='
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: archive-tar-minitar
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
@@ -99,14 +99,14 @@ dependencies:
99
99
  name: rake
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ! '>='
102
+ - - '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ! '>='
109
+ - - '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
@@ -127,189 +127,187 @@ dependencies:
127
127
  name: bump
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ! '>='
130
+ - - '>='
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ! '>='
137
+ - - '>='
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: json
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ! '>='
144
+ - - '>='
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ! '>='
151
+ - - '>='
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: gem-release
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - ! '>='
158
+ - - '>='
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ! '>='
165
+ - - '>='
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: pry
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - ! '>='
172
+ - - '>='
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ! '>='
179
+ - - '>='
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: simplecov
184
184
  requirement: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - ! '>='
186
+ - - '>='
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  type: :development
190
190
  prerelease: false
191
191
  version_requirements: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - ! '>='
193
+ - - '>='
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  - !ruby/object:Gem::Dependency
197
197
  name: simplecov-rcov
198
198
  requirement: !ruby/object:Gem::Requirement
199
199
  requirements:
200
- - - ! '>='
200
+ - - '>='
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
203
  type: :development
204
204
  prerelease: false
205
205
  version_requirements: !ruby/object:Gem::Requirement
206
206
  requirements:
207
- - - ! '>='
207
+ - - '>='
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  - !ruby/object:Gem::Dependency
211
211
  name: kwalify
212
212
  requirement: !ruby/object:Gem::Requirement
213
213
  requirements:
214
- - - ! '>='
214
+ - - '>='
215
215
  - !ruby/object:Gem::Version
216
216
  version: '0'
217
217
  type: :development
218
218
  prerelease: false
219
219
  version_requirements: !ruby/object:Gem::Requirement
220
220
  requirements:
221
- - - ! '>='
221
+ - - '>='
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: equivalent-xml
226
226
  requirement: !ruby/object:Gem::Requirement
227
227
  requirements:
228
- - - ! '>='
228
+ - - '>='
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  type: :development
232
232
  prerelease: false
233
233
  version_requirements: !ruby/object:Gem::Requirement
234
234
  requirements:
235
- - - ! '>='
235
+ - - '>='
236
236
  - !ruby/object:Gem::Version
237
237
  version: '0'
238
238
  - !ruby/object:Gem::Dependency
239
239
  name: yard-thor
240
240
  requirement: !ruby/object:Gem::Requirement
241
241
  requirements:
242
- - - ! '>='
242
+ - - '>='
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  type: :development
246
246
  prerelease: false
247
247
  version_requirements: !ruby/object:Gem::Requirement
248
248
  requirements:
249
- - - ! '>='
249
+ - - '>='
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  - !ruby/object:Gem::Dependency
253
253
  name: yard
254
254
  requirement: !ruby/object:Gem::Requirement
255
255
  requirements:
256
- - - ! '>='
256
+ - - '>='
257
257
  - !ruby/object:Gem::Version
258
258
  version: '0'
259
259
  type: :development
260
260
  prerelease: false
261
261
  version_requirements: !ruby/object:Gem::Requirement
262
262
  requirements:
263
- - - ! '>='
263
+ - - '>='
264
264
  - !ruby/object:Gem::Version
265
265
  version: '0'
266
266
  - !ruby/object:Gem::Dependency
267
267
  name: rspec_junit_formatter
268
268
  requirement: !ruby/object:Gem::Requirement
269
269
  requirements:
270
- - - ! '>='
270
+ - - '>='
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  type: :development
274
274
  prerelease: false
275
275
  version_requirements: !ruby/object:Gem::Requirement
276
276
  requirements:
277
- - - ! '>='
277
+ - - '>='
278
278
  - !ruby/object:Gem::Version
279
279
  version: '0'
280
280
  - !ruby/object:Gem::Dependency
281
281
  name: webmock
282
282
  requirement: !ruby/object:Gem::Requirement
283
283
  requirements:
284
- - - ! '>='
284
+ - - '>='
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  type: :development
288
288
  prerelease: false
289
289
  version_requirements: !ruby/object:Gem::Requirement
290
290
  requirements:
291
- - - ! '>='
291
+ - - '>='
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  - !ruby/object:Gem::Dependency
295
295
  name: rubocop
296
296
  requirement: !ruby/object:Gem::Requirement
297
297
  requirements:
298
- - - ! '>='
298
+ - - '>='
299
299
  - !ruby/object:Gem::Version
300
300
  version: '0'
301
301
  type: :development
302
302
  prerelease: false
303
303
  version_requirements: !ruby/object:Gem::Requirement
304
304
  requirements:
305
- - - ! '>='
305
+ - - '>='
306
306
  - !ruby/object:Gem::Version
307
307
  version: '0'
308
- description: ! 'This is a simple and easy-to-use Jenkins Pipeline generator with features
309
- focused on
310
-
311
- automating Job & Pipeline creation from the YAML files checked-in with your application
312
- source code'
308
+ description: |-
309
+ This is a simple and easy-to-use Jenkins Pipeline generator with features focused on
310
+ automating Job & Pipeline creation from the YAML files checked-in with your application source code
313
311
  email:
314
312
  - igor.moochnick@gmail.com
315
313
  - crimsonknave@gmail.com
@@ -442,17 +440,17 @@ require_paths:
442
440
  - lib
443
441
  required_ruby_version: !ruby/object:Gem::Requirement
444
442
  requirements:
445
- - - ! '>='
443
+ - - '>='
446
444
  - !ruby/object:Gem::Version
447
445
  version: '0'
448
446
  required_rubygems_version: !ruby/object:Gem::Requirement
449
447
  requirements:
450
- - - ! '>='
448
+ - - '>='
451
449
  - !ruby/object:Gem::Version
452
450
  version: '0'
453
451
  requirements: []
454
452
  rubyforge_project:
455
- rubygems_version: 2.4.5
453
+ rubygems_version: 2.1.9
456
454
  signing_key:
457
455
  specification_version: 4
458
456
  summary: This gem is will boostrap your Jenkins pipelines
@@ -510,3 +508,4 @@ test_files:
510
508
  - spec/lib/jenkins_pipeline_builder/utils_spec.rb
511
509
  - spec/lib/jenkins_pipeline_builder/view_spec.rb
512
510
  - spec/requests/pipeline_spec.rb
511
+ has_rdoc: