jenkins_pipeline_builder 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjVmMTJkOWM4Y2Q3ZTc2N2FmMDU0MjU2NDk3YTJmNmZiYzIzMWE0Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzBhZjUyNjgwM2JmN2FhYmEwYjM1NGQ4ZDVkYTVkYzhjMDlhNWQwZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmM2YThhNjUxMjlkOTJhODY5YjdjYmQ1Y2IzN2VjMTFmNzNhNzJkZDEyMjFh
|
10
|
+
YmE4NDQzN2QyN2M4MDY1MmM0MDg2ZGVjMTRkYTRkMzI4YWE0MDM1YTRkNzlm
|
11
|
+
Zjg4MzlkN2IxZTAwMzE0MjgzYTQwMTEzZmI5OTViOTRiZGU0MWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2FmNjEyMTk4ZjUwMTA3MzZiYWFhNTAwN2RlY2I3OTBiNWY4N2Q2ODRkMDdk
|
14
|
+
NGFmZjlhMDBjNDA5MmJlZDJjMTliNDcxNTNhNDY0N2UwYjRmMGRjNjFkNDNi
|
15
|
+
NmJmMzA3ZTY3MWNhMzA1Yjg5MzM0MDAzNmNlYWMyODdkMzlhOTY=
|
@@ -107,11 +107,16 @@ module JenkinsPipelineBuilder
|
|
107
107
|
if item.key?(:enabled) && item.key?(:parameters) && item.length == 2
|
108
108
|
enabled_switch = resolve_value(item[:enabled], settings, job_collection)
|
109
109
|
return [true, {}] if enabled_switch == 'false'
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
item.
|
114
|
-
|
110
|
+
if enabled_switch != 'true'
|
111
|
+
return [false, { 'value error' => "Invalid value for #{item[:enabled]}: #{enabled_switch}" }]
|
112
|
+
end
|
113
|
+
if item[:parameters].is_a? Hash
|
114
|
+
item = item.merge item[:parameters]
|
115
|
+
item.delete :parameters
|
116
|
+
item.delete :enabled
|
117
|
+
else
|
118
|
+
item = item[:parameters]
|
119
|
+
end
|
115
120
|
end
|
116
121
|
[true, item]
|
117
122
|
end
|
@@ -48,6 +48,15 @@ describe JenkinsPipelineBuilder::Compiler do
|
|
48
48
|
expect(item).to eq(rootPom: 'path_to_pomasd')
|
49
49
|
end
|
50
50
|
|
51
|
+
it 'generates correct new jobs when the params are a string' do
|
52
|
+
item = { enabled: '{{use1}}', parameters: 'path_to_pomasd' }
|
53
|
+
settings = { name: 'PushTest', description: 'DB Pipeline tooling', git_repo: 'git@github.roving.com:devops/DBPipeline.git', git_branch: 'master', excluded_user: 'buildmaster', hipchat_room: 'CD Builds', hipchat_auth_token: 'f3e98ed54605b36f56dd2c562e3775', discard_days: '30', discard_number: '100', maven_name: 'tools-maven-3.0.3', hipchat_jenkins_url: 'https://cd-jenkins.ad.prodcc.net/', use1: true }
|
54
|
+
job_collection = { '{{name}}-build' => { name: '{{name}}-build', type: :job, value: { name: '{{name}}-build', project_name: '{{name}}', builders: [{ maven3: { enabled: '{{use1}}', parameters: 'path_to_pomasd' } }] } }, 'global' => { name: 'global', type: :defaults, value: { name: 'global', description: 'DB Pipeline tooling', git_repo: 'git@github.roving.com:devops/DBPipeline.git', git_branch: 'master', excluded_user: 'buildmaster', hipchat_room: 'CD Builds', hipchat_auth_token: 'f3e98ed54605b36f56dd2c562e3775', discard_days: '30', discard_number: '100', maven_name: 'tools-maven-3.0.3', hipchat_jenkins_url: 'https://cd-jenkins.ad.prodcc.net/', use1: true } }, 'PushTest' => { name: 'PushTest', type: :project, value: { name: 'PushTest', hipchat_jenkins_url: 'https://cd-jenkins.ad.prodcc.net/', jobs: [{ :"{{name}}-build" => {} }] }, settings: { name: 'PushTest', description: 'DB Pipeline tooling', git_repo: 'git@github.roving.com:devops/DBPipeline.git', git_branch: 'master', excluded_user: 'buildmaster', hipchat_room: 'CD Builds', hipchat_auth_token: 'f3e98ed54605b36f56dd2c562e3775', discard_days: '30', discard_number: '100', maven_name: 'tools-maven-3.0.3', hipchat_jenkins_url: 'https://cd-jenkins.ad.prodcc.net/', use1: true } } }
|
55
|
+
success, item = compiler.handle_enable(item, settings, job_collection)
|
56
|
+
expect(success).to be true
|
57
|
+
expect(item).to eq('path_to_pomasd')
|
58
|
+
end
|
59
|
+
|
51
60
|
it 'generates correct new jobs with false' do
|
52
61
|
item = { enabled: '{{use1}}', parameters: { rootPom: 'path_to_pomasd' } }
|
53
62
|
settings = { name: 'PushTest', description: 'DB Pipeline tooling', git_repo: 'git@github.roving.com:devops/DBPipeline.git', git_branch: 'master', excluded_user: 'buildmaster', hipchat_room: 'CD Builds', hipchat_auth_token: 'f3e98ed54605b36f56dd2c562e3775', discard_days: '30', discard_number: '100', maven_name: 'tools-maven-3.0.3', hipchat_jenkins_url: 'https://cd-jenkins.ad.prodcc.net/', use1: false }
|
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.10.
|
4
|
+
version: 0.10.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-01-
|
12
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|