dapp 0.5.5 → 0.5.6
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 +4 -4
- data/lib/dapp/builder/chef.rb +23 -11
- data/lib/dapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae5353ff9630589b96b901a1a154bd340bc54866
|
4
|
+
data.tar.gz: de780b94214808fe3d156d07d2563efd5dbb5bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6852b64b7e5001053136398325d8af8120925505b4610c4b65a5a61553ca9f81088075926879c5919169c109d3a54dc0126943f0f9c5d7795ca6ce1168c03fad
|
7
|
+
data.tar.gz: 9eef518c4c08935d9907488f4c0b784db6fe9736b9b587ad0b5ca9c8a1194f152d67b716db54174659da32a951cc20f299b621fc599060bb570f4b5e89f3c036
|
data/lib/dapp/builder/chef.rb
CHANGED
@@ -208,14 +208,14 @@ module Dapp
|
|
208
208
|
|
209
209
|
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
210
210
|
def install_stage_cookbooks(stage)
|
211
|
-
|
212
|
-
|
213
|
-
['attributes/common', 'attributes'],
|
214
|
-
["attributes/#{stage}", 'attributes'],
|
215
|
-
["files/#{stage}", 'files/default'],
|
216
|
-
["templates/#{stage}", 'templates/default']].select { |from, _| cookbook_path.join(from).exist? }
|
211
|
+
select_existing_paths = ->(cookbook_path, paths) do
|
212
|
+
paths.select { |from, _| cookbook_path.join(from).exist? }
|
217
213
|
end
|
218
214
|
|
215
|
+
common_paths = [['metadata.json', 'metadata.json'],
|
216
|
+
["files/#{stage}", 'files/default'],
|
217
|
+
["templates/#{stage}", 'templates/default']]
|
218
|
+
|
219
219
|
install_paths = Dir[cookbooks_vendor_path('*')]
|
220
220
|
.map(&Pathname.method(:new))
|
221
221
|
.map do |cookbook_path|
|
@@ -230,18 +230,30 @@ module Dapp
|
|
230
230
|
.map { |recipe| ["recipes/#{stage}/#{recipe}.rb", "recipes/#{recipe}.rb"] }
|
231
231
|
.select { |from, _| cookbook_path.join(from).exist? }
|
232
232
|
|
233
|
+
common_project_paths = select_existing_paths.call(
|
234
|
+
cookbook_path, [*common_paths,
|
235
|
+
['attributes/common', 'attributes'],
|
236
|
+
["attributes/#{stage}", 'attributes']]
|
237
|
+
)
|
238
|
+
|
233
239
|
if recipe_paths.any?
|
234
|
-
[*recipe_paths, *
|
240
|
+
[*recipe_paths, *common_project_paths]
|
235
241
|
else
|
236
|
-
[nil, *
|
242
|
+
[nil, *common_project_paths]
|
237
243
|
end
|
238
244
|
elsif is_mdapp && mdapp_enabled
|
239
245
|
recipe_path = "recipes/#{stage}.rb"
|
240
246
|
|
247
|
+
common_mdapp_paths = select_existing_paths.call(
|
248
|
+
cookbook_path, [*common_paths,
|
249
|
+
['attributes/common.rb', 'attributes/common.rb'],
|
250
|
+
["attributes/#{stage}.rb", "attributes/#{stage}.rb"]]
|
251
|
+
)
|
252
|
+
|
241
253
|
if cookbook_path.join(recipe_path).exist?
|
242
|
-
[[recipe_path, recipe_path], *
|
254
|
+
[[recipe_path, recipe_path], *common_mdapp_paths]
|
243
255
|
else
|
244
|
-
[nil, *
|
256
|
+
[nil, *common_mdapp_paths]
|
245
257
|
end
|
246
258
|
else
|
247
259
|
[['.', '.']]
|
@@ -252,7 +264,7 @@ module Dapp
|
|
252
264
|
|
253
265
|
_stage_cookbooks_path(stage).mkpath
|
254
266
|
install_paths.each do |cookbook_path, paths|
|
255
|
-
cookbook = cookbook_path.basename
|
267
|
+
cookbook = cookbook_path.basename.to_s
|
256
268
|
|
257
269
|
paths.each do |from, to|
|
258
270
|
if from.nil?
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|