dapp 0.7.17 → 0.7.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac3cccdbfe9bb2fb9aab05958f1fa1d8f2db5ab5
4
- data.tar.gz: c8518534ebe63840f47ff76327186f6b78d542bc
3
+ metadata.gz: a0dcb2453cc6b24dceb7490d086e4c755c56d4c7
4
+ data.tar.gz: 438de659b1cde4c9312e959cdb406a51a99e3363
5
5
  SHA512:
6
- metadata.gz: 043df0615ad8084c2deca2fec4bb98f932a60a3ce7969f2ad84e4a14fef2643ed6e5889a8387c67701b287ef945d0f7198b1143be1fb3e24b78aaa9e5ae7bc6b
7
- data.tar.gz: 12099bf042bb1282be953c32f12bce147fe2a6103a90a82eb88dcf3e296bb1af4d782fde0aa12988d6caad8dc2b881dad8a222f703f82ce4ba7caf7f4b8a28ef
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
- @_artifact_dependencies.concat(args)
28
+ _artifact_dependencies.concat(args)
30
29
  end
31
30
 
32
31
  def export(*args, &blk)
33
- @_export.concat begin
34
- artifact_config = pass_to_default(ArtifactDimg.new("artifact-#{SecureRandom.hex(2)}", project: project))
35
- artifact = Directive::Artifact.new(project: project, config: artifact_config)
36
- artifact.send(:export, *args, &blk)
37
- artifact._export
38
- end
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
@@ -8,7 +8,7 @@ module Dapp
8
8
  end
9
9
 
10
10
  def cookbook_path(*path)
11
- home_path('.dapp_chef', *path)
11
+ make_path(project.cookbook_path, *path)
12
12
  end
13
13
 
14
14
  def tmp_path(*path)
@@ -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
- repo_project_images_detailed(registry).each do |_, attrs|
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 repo_project_images_detailed(registry)
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
- repo_project_images_detailed(registry).map { |_, attrs| attrs[:id] if attrs[:parent] == iid }.compact
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
- repo_project_images_detailed(registry).map { |tag, attrs| tag if hierarchy.include? attrs[:id] }.compact
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
@@ -1,5 +1,5 @@
1
1
  # Version
2
2
  module Dapp
3
- VERSION = '0.7.17'.freeze
3
+ VERSION = '0.7.18'.freeze
4
4
  BUILD_CACHE_VERSION = 6
5
5
  end
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.17
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-05 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout