jenkins_pipeline_builder 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jenkins_pipeline_builder/extensions/builders.rb +15 -0
- data/lib/jenkins_pipeline_builder/extensions/publishers.rb +28 -0
- data/lib/jenkins_pipeline_builder/version.rb +1 -1
- data/spec/lib/jenkins_pipeline_builder/extensions/builders_spec.rb +32 -0
- data/spec/lib/jenkins_pipeline_builder/extensions/publishers_spec.rb +46 -0
- data/spec/lib/jenkins_pipeline_builder/extensions/registered_spec.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bf0df7f8b52e79d53a8d106abab7c4861384b59
|
4
|
+
data.tar.gz: 3585b7e0a012af2e09119404e74ac7799c6c2310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fe2202133c819bf5662aefc1821e348ee8b4cd27e8e8f01caea41fafb971337534d4cfe78075a3680be2103bd28665528c8c70697af4bb9b8261359d8fd1f42
|
7
|
+
data.tar.gz: d1036ed7087a645635880ae86292308190ad3d32eacd7afe1db2e16264081ae3a59785fb252d85e844223a380445da728c5425cb4ce66a33a940b94ae898069b
|
@@ -323,6 +323,21 @@ builder do
|
|
323
323
|
end
|
324
324
|
end
|
325
325
|
|
326
|
+
builder do
|
327
|
+
name :nodejs_script
|
328
|
+
plugin_id 'nodejs'
|
329
|
+
description 'Lets you run nodejs scripts as a build step.'
|
330
|
+
jenkins_name 'Node_js script'
|
331
|
+
announced false
|
332
|
+
|
333
|
+
xml do |params|
|
334
|
+
send('jenkins.plugins.nodejs.NodeJsCommandInterpreter', 'plugin' => 'nodejs@0.2.2') do
|
335
|
+
command params[:script]
|
336
|
+
nodeJSInstallationName params[:nodeJS_installation_name]
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
326
341
|
builder do
|
327
342
|
name :checkmarx_scan
|
328
343
|
plugin_id 'checkmarx'
|
@@ -565,3 +565,31 @@ publisher do
|
|
565
565
|
end
|
566
566
|
end
|
567
567
|
end
|
568
|
+
|
569
|
+
publisher do
|
570
|
+
name :cucumber_reports
|
571
|
+
plugin_id 'cucumber-reports'
|
572
|
+
description 'Provides Jenkins integration for publishing the cucumber reports'
|
573
|
+
jenkins_name 'Publish cucumber results as a report'
|
574
|
+
announced true
|
575
|
+
|
576
|
+
version '0' do
|
577
|
+
xml do
|
578
|
+
send('net.masterthought.jenkins.CucumberReportPublisher') do
|
579
|
+
jsonReportDirectory
|
580
|
+
pluginUrlPath
|
581
|
+
skippedFails false
|
582
|
+
undefinedFails false
|
583
|
+
noFlashCharts false
|
584
|
+
end
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
version '3.0.0' do
|
589
|
+
xml do |params|
|
590
|
+
send('net.masterthought.jenkins.CucumberReportPublisher') do
|
591
|
+
fileIncludePattern params[:file_include_pattern]
|
592
|
+
end
|
593
|
+
end
|
594
|
+
end
|
595
|
+
end
|
@@ -237,6 +237,38 @@ describe 'builders' do
|
|
237
237
|
end
|
238
238
|
end
|
239
239
|
|
240
|
+
context 'nodejs_script' do
|
241
|
+
let(:params) do
|
242
|
+
{
|
243
|
+
builders: {
|
244
|
+
nodejs_script: {
|
245
|
+
script: 'console.log("Hello World")', nodeJS_installation_name: 'Node_6.9.2'
|
246
|
+
}
|
247
|
+
}
|
248
|
+
}
|
249
|
+
end
|
250
|
+
|
251
|
+
before :each do
|
252
|
+
allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
|
253
|
+
list_installed: { 'nodejs' => '0.2.2' }
|
254
|
+
)
|
255
|
+
begin
|
256
|
+
JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
|
257
|
+
rescue RuntimeError => err
|
258
|
+
puts 'Runtime Error: ' + err.to_s
|
259
|
+
end
|
260
|
+
builder = @n_xml.root.children.first
|
261
|
+
expect(builder.name).to match 'jenkins.plugins.nodejs.NodeJsCommandInterpreter'
|
262
|
+
end
|
263
|
+
|
264
|
+
it 'generates a configuration' do
|
265
|
+
command = @n_xml.xpath '//jenkins.plugins.nodejs.NodeJsCommandInterpreter/command'
|
266
|
+
install_version = @n_xml.xpath '//jenkins.plugins.nodejs.NodeJsCommandInterpreter/nodeJSInstallationName'
|
267
|
+
expect(command.children.first.content).to eq 'console.log("Hello World")'
|
268
|
+
expect(install_version.children.first.content).to eq 'Node_6.9.2'
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
240
272
|
context 'conditional_multijob_step' do
|
241
273
|
let(:default_params) do
|
242
274
|
{
|
@@ -242,6 +242,52 @@ describe 'publishers' do
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
+
context 'cucumber_reports' do
|
246
|
+
context '0' do
|
247
|
+
before :each do
|
248
|
+
allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
|
249
|
+
list_installed: { 'cucumber-reports' => '0' }
|
250
|
+
)
|
251
|
+
end
|
252
|
+
it 'generates a configuration' do
|
253
|
+
params = { publishers: { cucumber_reports: {} } }
|
254
|
+
cucumber_reports = JenkinsPipelineBuilder.registry.registry[:job][:publishers][:cucumber_reports]
|
255
|
+
expect(cucumber_reports.extension.min_version).to eq '0'
|
256
|
+
|
257
|
+
JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
|
258
|
+
|
259
|
+
publisher = @n_xml.root.children.first
|
260
|
+
expect(publisher.name).to match 'net.masterthought.jenkins.CucumberReportPublisher'
|
261
|
+
children = publisher.children.map(&:name)
|
262
|
+
expect(children).to include 'jsonReportDirectory'
|
263
|
+
expect(children).to include 'pluginUrlPath'
|
264
|
+
expect(children).to include 'skippedFails'
|
265
|
+
expect(children).to include 'undefinedFails'
|
266
|
+
expect(children).to include 'noFlashCharts'
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
context '3.0.0' do
|
271
|
+
before :each do
|
272
|
+
allow(JenkinsPipelineBuilder.client).to receive(:plugin).and_return double(
|
273
|
+
list_installed: { 'cucumber-reports' => '3.0.0' }
|
274
|
+
)
|
275
|
+
end
|
276
|
+
it 'generates a configuration' do
|
277
|
+
params = { publishers: { cucumber_reports: {} } }
|
278
|
+
cucumber_reports = JenkinsPipelineBuilder.registry.registry[:job][:publishers][:cucumber_reports]
|
279
|
+
expect(cucumber_reports.extension.min_version).to eq '3.0.0'
|
280
|
+
|
281
|
+
JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)
|
282
|
+
|
283
|
+
publisher = @n_xml.root.children.first
|
284
|
+
expect(publisher.name).to match 'net.masterthought.jenkins.CucumberReportPublisher'
|
285
|
+
children = publisher.children.map(&:name)
|
286
|
+
expect(children).to include 'fileIncludePattern'
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
245
291
|
context 'git' do
|
246
292
|
it 'generates a configuration'
|
247
293
|
end
|
@@ -17,6 +17,7 @@ PUBLISHERS = {
|
|
17
17
|
claim_broken_build: ['0'],
|
18
18
|
cobertura_report: ['0'],
|
19
19
|
coverage_result: ['0'],
|
20
|
+
cucumber_reports: ['0', '3.0.0'],
|
20
21
|
description_setter: ['0'],
|
21
22
|
downstream: ['0'],
|
22
23
|
email_ext: ['0'],
|
@@ -45,7 +46,8 @@ BUILDERS = {
|
|
45
46
|
checkmarx_scan: ['0'],
|
46
47
|
system_groovy: ['0'],
|
47
48
|
sonar_standalone: ['0'],
|
48
|
-
conditional_multijob_step: ['0']
|
49
|
+
conditional_multijob_step: ['0'],
|
50
|
+
nodejs_script: ['0']
|
49
51
|
}.freeze
|
50
52
|
|
51
53
|
TRIGGERS = {
|
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.1.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: 2017-02-07 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.
|
487
|
+
rubygems_version: 2.6.8
|
488
488
|
signing_key:
|
489
489
|
specification_version: 4
|
490
490
|
summary: This gem is will boostrap your Jenkins pipelines
|