dapp 0.4.5 → 0.4.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/config/en/net_status.yml +2 -0
- data/lib/dapp.rb +7 -6
- data/lib/dapp/builder/chef.rb +24 -4
- data/lib/dapp/builder/chef/error.rb +11 -0
- data/lib/dapp/error/base.rb +1 -1
- data/lib/dapp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bc6a29dd7b243dc8d6f5432442b085926c05ce7
|
4
|
+
data.tar.gz: 771c938cc250204bc86e50ee796952bbe14d02b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce285874f213efc4f28908cf22d9f7a32c71aa0d0f5554ff89740c6308418a74ccd5c4f050f999077aaf40f7d68022712ebb00458c3d176c4595ae0c4bee35d
|
7
|
+
data.tar.gz: b8f9bc10ec5e3cd36d6e80dc6fc0aceac8bc3fc0c4afaf884da4941f641f2e099e608d0aab82b40163c9c990de22ea6a9a3dc22d4592c45fef1a833cc25e05dd
|
data/config/en/net_status.yml
CHANGED
@@ -27,3 +27,5 @@ en:
|
|
27
27
|
stage_artifact_not_associated: "Artifact not associated with any stage!"
|
28
28
|
stage_artifact_incorrect_associated_value: "Artifact option '%{option}' has incorrect value '%{value}'!"
|
29
29
|
git_artifact_unexpected_attribute: "'%{type}' git artifact doesn't has attribute '%{attr}'!"
|
30
|
+
chef:
|
31
|
+
stage_path_overlap: "Cannot install '%{cookbook}' cookbook's path %{from} into %{to}: already exists"
|
data/lib/dapp.rb
CHANGED
@@ -25,6 +25,12 @@ require 'dapp/helper/paint'
|
|
25
25
|
require 'dapp/helper/streaming'
|
26
26
|
require 'dapp/helper/shellout'
|
27
27
|
require 'dapp/helper/net_status'
|
28
|
+
require 'dapp/error/base'
|
29
|
+
require 'dapp/error/application'
|
30
|
+
require 'dapp/error/build'
|
31
|
+
require 'dapp/error/config'
|
32
|
+
require 'dapp/error/controller'
|
33
|
+
require 'dapp/error/shellout'
|
28
34
|
require 'dapp/cli'
|
29
35
|
require 'dapp/cli/base'
|
30
36
|
require 'dapp/cli/build'
|
@@ -47,6 +53,7 @@ require 'dapp/config/git_artifact'
|
|
47
53
|
require 'dapp/config/docker'
|
48
54
|
require 'dapp/builder/base'
|
49
55
|
require 'dapp/builder/chef'
|
56
|
+
require 'dapp/builder/chef/error'
|
50
57
|
require 'dapp/builder/chef/cookbook_metadata'
|
51
58
|
require 'dapp/builder/chef/berksfile'
|
52
59
|
require 'dapp/builder/shell'
|
@@ -79,12 +86,6 @@ require 'dapp/git_repo/base'
|
|
79
86
|
require 'dapp/git_repo/own'
|
80
87
|
require 'dapp/git_repo/remote'
|
81
88
|
require 'dapp/git_artifact'
|
82
|
-
require 'dapp/error/base'
|
83
|
-
require 'dapp/error/application'
|
84
|
-
require 'dapp/error/build'
|
85
|
-
require 'dapp/error/config'
|
86
|
-
require 'dapp/error/controller'
|
87
|
-
require 'dapp/error/shellout'
|
88
89
|
require 'dapp/exception/base'
|
89
90
|
require 'dapp/exception/introspect_image'
|
90
91
|
|
data/lib/dapp/builder/chef.rb
CHANGED
@@ -214,6 +214,7 @@ module Dapp
|
|
214
214
|
@install_stage_cookbooks[stage] ||= true.tap do
|
215
215
|
common_paths = proc do |cookbook_path|
|
216
216
|
[['metadata.json', 'metadata.json'],
|
217
|
+
["attributes/common", 'attributes'],
|
217
218
|
["attributes/#{stage}", 'attributes'],
|
218
219
|
["files/#{stage}", 'files/default'],
|
219
220
|
["templates/#{stage}", 'templates/default']
|
@@ -257,16 +258,35 @@ module Dapp
|
|
257
258
|
|
258
259
|
stage_cookbooks_path(stage).mkpath
|
259
260
|
install_paths.each do |cookbook_path, paths|
|
261
|
+
cookbook = cookbook_path.basename
|
262
|
+
|
260
263
|
paths.each do |from, to|
|
261
264
|
if from.nil?
|
262
|
-
to_path = stage_cookbooks_path(stage,
|
265
|
+
to_path = stage_cookbooks_path(stage, cookbook, 'recipes/void.rb')
|
263
266
|
to_path.parent.mkpath
|
264
267
|
FileUtils.touch to_path
|
265
268
|
else
|
266
269
|
from_path = cookbook_path.join(from)
|
267
|
-
to_path = stage_cookbooks_path(stage,
|
268
|
-
to_path.
|
269
|
-
|
270
|
+
to_path = stage_cookbooks_path(stage, cookbook, to)
|
271
|
+
if from_path.directory? && to_path.exist?
|
272
|
+
Dir[from_path.join('**/*')]
|
273
|
+
.map(&Pathname.method(:new))
|
274
|
+
.each do |from_subpath|
|
275
|
+
to_subpath = to_path.join(from_subpath.relative_path_from(from_path))
|
276
|
+
raise Error, code: :stage_path_overlap,
|
277
|
+
data: { stage: stage,
|
278
|
+
cookbook: cookbook,
|
279
|
+
from: from_subpath.relative_path_from(cookbook_path),
|
280
|
+
to: to_subpath.relative_path_from(stage_cookbooks_path(stage, cookbook)),
|
281
|
+
} if to_subpath.exist?
|
282
|
+
|
283
|
+
to_subpath.parent.mkpath
|
284
|
+
FileUtils.cp_r from_subpath, to_subpath
|
285
|
+
end
|
286
|
+
else
|
287
|
+
to_path.parent.mkpath
|
288
|
+
FileUtils.cp_r from_path, to_path
|
289
|
+
end
|
270
290
|
end
|
271
291
|
end
|
272
292
|
end
|
data/lib/dapp/error/base.rb
CHANGED
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
@@ -351,6 +351,7 @@ files:
|
|
351
351
|
- lib/dapp/builder/chef.rb
|
352
352
|
- lib/dapp/builder/chef/berksfile.rb
|
353
353
|
- lib/dapp/builder/chef/cookbook_metadata.rb
|
354
|
+
- lib/dapp/builder/chef/error.rb
|
354
355
|
- lib/dapp/builder/shell.rb
|
355
356
|
- lib/dapp/cli.rb
|
356
357
|
- lib/dapp/cli/base.rb
|