dapp 0.7.17 → 0.7.18
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/config/artifact_group.rb +20 -16
- data/lib/dapp/config/dimg/instance_methods.rb +2 -1
- data/lib/dapp/dimg/path.rb +1 -1
- data/lib/dapp/git_artifact.rb +2 -2
- data/lib/dapp/project.rb +8 -0
- data/lib/dapp/project/command/stages/cleanup_repo.rb +7 -5
- 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: a0dcb2453cc6b24dceb7490d086e4c755c56d4c7
|
4
|
+
data.tar.gz: 438de659b1cde4c9312e959cdb406a51a99e3363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2f7072fc7882ef94e2d9864ef7bad40dad70d820a679b2267da3316931118c6a02bfbced85ec3c451b5bc47ce58975e12d85e50225501ba90727ef6e27e61d0
|
7
|
+
data.tar.gz: e682d5bc70806fcd53af05c2ded8dc9a16471dff0ee5d6774038ff8ec4f4035cc629320a787991e515cbc09defb3e2e84a113cc539085d8dcbfa2b7623489d74
|
@@ -2,15 +2,6 @@ module Dapp
|
|
2
2
|
module Config
|
3
3
|
# ArtifactGroup
|
4
4
|
class ArtifactGroup < DimgGroup
|
5
|
-
attr_reader :_artifact_dependencies, :_export
|
6
|
-
|
7
|
-
def initialize(project:)
|
8
|
-
@_artifact_dependencies = []
|
9
|
-
@_export = []
|
10
|
-
|
11
|
-
super(project: project)
|
12
|
-
end
|
13
|
-
|
14
5
|
def _shell(&blk)
|
15
6
|
@_shell ||= Directive::Shell::Artifact.new(project: project, &blk)
|
16
7
|
end
|
@@ -19,6 +10,14 @@ module Dapp
|
|
19
10
|
@_docker ||= Directive::Docker::Artifact.new(project: project, &blk)
|
20
11
|
end
|
21
12
|
|
13
|
+
def _export
|
14
|
+
@_export ||= []
|
15
|
+
end
|
16
|
+
|
17
|
+
def _artifact_dependencies
|
18
|
+
@_artifact_dependencies ||= []
|
19
|
+
end
|
20
|
+
|
22
21
|
undef :artifact
|
23
22
|
undef :dimg
|
24
23
|
undef :dimg_group
|
@@ -26,16 +25,21 @@ module Dapp
|
|
26
25
|
protected
|
27
26
|
|
28
27
|
def artifact_depends_on(*args)
|
29
|
-
|
28
|
+
_artifact_dependencies.concat(args)
|
30
29
|
end
|
31
30
|
|
32
31
|
def export(*args, &blk)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
_export.concat begin
|
33
|
+
artifact_config = pass_to_default(ArtifactDimg.new(
|
34
|
+
"artifact-#{SecureRandom.hex(2)}",
|
35
|
+
project: project
|
36
|
+
))
|
37
|
+
|
38
|
+
artifact = Directive::Artifact.new(project: project, config: artifact_config)
|
39
|
+
artifact.send(:export, *args, &blk)
|
40
|
+
|
41
|
+
artifact._export
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
def check_dimg_directive_order(_directive)
|
@@ -185,7 +185,8 @@ module Dapp
|
|
185
185
|
def passed_directives
|
186
186
|
[:@_chef, :@_shell, :@_docker,
|
187
187
|
:@_git_artifact, :@_mount,
|
188
|
-
:@_artifact, :@_builder, :@_dev_mode
|
188
|
+
:@_artifact, :@_builder, :@_dev_mode,
|
189
|
+
:@_install_dependencies, :@_setup_dependencies]
|
189
190
|
end
|
190
191
|
end
|
191
192
|
end
|
data/lib/dapp/dimg/path.rb
CHANGED
data/lib/dapp/git_artifact.rb
CHANGED
@@ -67,11 +67,11 @@ module Dapp
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def paramshash
|
70
|
-
Digest::SHA256.hexdigest [to, cwd, *include_paths, *exclude_paths, owner, group].map(&:to_s).join(':::')
|
70
|
+
Digest::SHA256.hexdigest [full_name, to, cwd, *include_paths, *exclude_paths, owner, group].map(&:to_s).join(':::')
|
71
71
|
end
|
72
72
|
|
73
73
|
def exclude_paths(with_cwd = false)
|
74
|
-
base_paths(@exclude_paths, with_cwd)
|
74
|
+
base_paths(repo.dimg.project.system_files.concat(@exclude_paths), with_cwd)
|
75
75
|
end
|
76
76
|
|
77
77
|
def include_paths(with_cwd = false)
|
data/lib/dapp/project.rb
CHANGED
@@ -84,6 +84,10 @@ module Dapp
|
|
84
84
|
@path ||= expand_path(dappfile_path)
|
85
85
|
end
|
86
86
|
|
87
|
+
def cookbook_path
|
88
|
+
File.join(path, '.dapp_chef')
|
89
|
+
end
|
90
|
+
|
87
91
|
def build_path
|
88
92
|
@build_path ||= begin
|
89
93
|
if cli_options[:build_dir]
|
@@ -94,6 +98,10 @@ module Dapp
|
|
94
98
|
end
|
95
99
|
end
|
96
100
|
|
101
|
+
def system_files
|
102
|
+
[dappfile_path, cookbook_path, build_path].map { |p| File.basename(p) }
|
103
|
+
end
|
104
|
+
|
97
105
|
def stage_cache
|
98
106
|
"dimgstage-#{name}"
|
99
107
|
end
|
@@ -70,7 +70,7 @@ module Dapp
|
|
70
70
|
def proper_repo_git_commit(registry)
|
71
71
|
log_proper_git_commit do
|
72
72
|
unproper_images = []
|
73
|
-
|
73
|
+
repo_project_dappstage_images_detailed(registry).each do |_, attrs|
|
74
74
|
attrs[:labels].each do |repo_name, commit|
|
75
75
|
next if (repo = project_git_repositories[repo_name]).nil?
|
76
76
|
git = repo.name == 'own' ? :git : :git_bare
|
@@ -81,9 +81,11 @@ module Dapp
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
def
|
84
|
+
def repo_project_dappstage_images_detailed(registry)
|
85
85
|
@repo_project_images_detailed ||= begin
|
86
86
|
registry.tags.map do |tag|
|
87
|
+
next unless tag.start_with?('dimgstage')
|
88
|
+
|
87
89
|
image_history = registry.image_history(tag)
|
88
90
|
attrs = {
|
89
91
|
id: registry.image_id(tag),
|
@@ -91,7 +93,7 @@ module Dapp
|
|
91
93
|
labels: image_history['config']['Labels']
|
92
94
|
}
|
93
95
|
[tag, attrs]
|
94
|
-
end
|
96
|
+
end.compact
|
95
97
|
end
|
96
98
|
end
|
97
99
|
|
@@ -103,12 +105,12 @@ module Dapp
|
|
103
105
|
hierarchy.concat(iids)
|
104
106
|
break if begin
|
105
107
|
iids.map! do |iid|
|
106
|
-
|
108
|
+
repo_project_dappstage_images_detailed(registry).map { |_, attrs| attrs[:id] if attrs[:parent] == iid }.compact
|
107
109
|
end.flatten!.empty?
|
108
110
|
end
|
109
111
|
end
|
110
112
|
|
111
|
-
|
113
|
+
repo_project_dappstage_images_detailed(registry).map { |tag, attrs| tag if hierarchy.include? attrs[:id] }.compact
|
112
114
|
end
|
113
115
|
|
114
116
|
def remove_repo_images(registry, tags)
|
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.7.
|
4
|
+
version: 0.7.18
|
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-12-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|