dapp 0.19.5 → 0.19.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/config/en/common.yml +0 -5
  3. data/lib/dapp.rb +1 -7
  4. data/lib/dapp/cli/command/base.rb +15 -3
  5. data/lib/dapp/dimg/build/stage/base.rb +19 -15
  6. data/lib/dapp/dimg/build/stage/ga_archive.rb +12 -1
  7. data/lib/dapp/dimg/build/stage/ga_base.rb +9 -24
  8. data/lib/dapp/dimg/build/stage/ga_latest_patch.rb +7 -6
  9. data/lib/dapp/dimg/build/stage/{ga_related_dependencies_base.rb → ga_related_base.rb} +2 -2
  10. data/lib/dapp/dimg/build/stage/install/ga_post_install_patch.rb +6 -2
  11. data/lib/dapp/dimg/build/stage/install/ga_pre_install_patch.rb +6 -2
  12. data/lib/dapp/dimg/build/stage/setup/ga_post_setup_patch.rb +24 -1
  13. data/lib/dapp/dimg/build/stage/setup/ga_pre_setup_patch.rb +6 -2
  14. data/lib/dapp/dimg/cli/command/base.rb +2 -2
  15. data/lib/dapp/dimg/cli/command/dimg/run.rb +1 -1
  16. data/lib/dapp/dimg/cli/command/dimg/stages/base.rb +2 -2
  17. data/lib/dapp/dimg/cli/command/dimg/tag.rb +1 -1
  18. data/lib/dapp/dimg/git_artifact.rb +2 -2
  19. data/lib/dapp/kube/cli/command/kube/lint.rb +1 -1
  20. data/lib/dapp/kube/cli/command/kube/render.rb +1 -1
  21. data/lib/dapp/kube/cli/command/kube/secret_edit.rb +1 -1
  22. data/lib/dapp/kube/cli/command/kube/secret_extract.rb +1 -1
  23. data/lib/dapp/kube/cli/command/kube/secret_generate.rb +1 -1
  24. data/lib/dapp/kube/cli/command/kube/secret_key_generate.rb +3 -0
  25. data/lib/dapp/kube/cli/command/kube/secret_regenerate.rb +1 -1
  26. data/lib/dapp/version.rb +2 -2
  27. metadata +3 -9
  28. data/lib/dapp/dimg/build/stage/ga_archive_dependencies.rb +0 -27
  29. data/lib/dapp/dimg/build/stage/ga_dependencies_base.rb +0 -28
  30. data/lib/dapp/dimg/build/stage/install/ga_post_install_patch_dependencies.rb +0 -22
  31. data/lib/dapp/dimg/build/stage/install/ga_pre_install_patch_dependencies.rb +0 -22
  32. data/lib/dapp/dimg/build/stage/setup/ga_post_setup_patch_dependencies.rb +0 -36
  33. data/lib/dapp/dimg/build/stage/setup/ga_pre_setup_patch_dependencies.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aae9ac6942e53a5dfc819ef116bace7d9b6ee0b796854c19f1bbef759384fbd1
4
- data.tar.gz: e6755cecd0d3974ecbd5f02272e1d7838fe1abd6e969753290420ca653821653
3
+ metadata.gz: f75eb328fb6d3f8a525907c77d0e22c098ebce785a9dc059c5cef6e7ec18031e
4
+ data.tar.gz: 173934daabfbdce583ae9fe00b2f2c4fa9ad0c1b0013e94bfdfd4570a99358cc
5
5
  SHA512:
6
- metadata.gz: 82b164a8819abb9deac8ec34f7c3bf21853bb0e625698b73bf895ad1075ecf25c14666ceb5c1db2426c6fff0c28148541160cb93b49feb9d9b6e39c68143b57e
7
- data.tar.gz: f72c0dcada882ed289d89f94574c0d06c4f32f08d8241f616c6c2e72c50b11506e2957e8a6359960791f53b7bf4949f6baa22468a226cf7090fe24ac638ff1a1
6
+ metadata.gz: 17901157d15cd5716296469ef9a6a85ebf1d0c316f332b88fd62e06015a63c353f01403ec8ec4541c5378cb254986b1b698b8b36325594a9225c5d75191a849e
7
+ data.tar.gz: 94c15b36849fed04ef597bf19e2dba9b483d8f37bda51a707e5da632b10de899d385c94f50c6fefa579bb04f7031744eae0b7a3273da12538a5290cdc6764caf
data/config/en/common.yml CHANGED
@@ -67,22 +67,17 @@ en:
67
67
  import_artifact: 'Import Artifact'
68
68
  before_install: 'Before install'
69
69
  before_install_artifact: 'Before install artifact'
70
- g_a_archive_dependencies: 'Git artifacts dependencies'
71
70
  g_a_archive: 'Git artifacts: create archive'
72
71
  install:
73
- g_a_pre_install_patch_dependencies: 'Git artifacts dependencies'
74
72
  g_a_pre_install_patch: 'Git artifacts: apply patches (before install)'
75
73
  install: 'Install'
76
- g_a_post_install_patch_dependencies: 'Git artifacts dependencies'
77
74
  g_a_post_install_patch: 'Git artifacts: apply patches (after install)'
78
75
  after_install_artifact: 'After install artifact'
79
76
  before_setup: 'Before setup'
80
77
  before_setup_artifact: 'Before setup artifact'
81
78
  setup:
82
- g_a_pre_setup_patch_dependencies: 'Git artifacts dependencies'
83
79
  g_a_pre_setup_patch: 'Git artifacts: apply patches (before setup)'
84
80
  setup: 'Setup'
85
- g_a_post_setup_patch_dependencies: 'Git artifacts dependencies'
86
81
  g_a_post_setup_patch: 'Git artifacts: apply patches (after setup)'
87
82
  after_setup_artifact: 'After setup artifact'
88
83
  g_a_latest_patch: 'Git artifacts: latest patch'
data/lib/dapp.rb CHANGED
@@ -164,28 +164,22 @@ require 'dapp/dimg/build/stage/mod/logging'
164
164
  require 'dapp/dimg/build/stage/mod/group'
165
165
  require 'dapp/dimg/build/stage/base'
166
166
  require 'dapp/dimg/build/stage/ga_base'
167
- require 'dapp/dimg/build/stage/ga_dependencies_base'
168
- require 'dapp/dimg/build/stage/ga_related_dependencies_base'
167
+ require 'dapp/dimg/build/stage/ga_related_base'
169
168
  require 'dapp/dimg/build/stage/artifact_base'
170
169
  require 'dapp/dimg/build/stage/artifact_default'
171
170
  require 'dapp/dimg/build/stage/from'
172
171
  require 'dapp/dimg/build/stage/import_artifact'
173
172
  require 'dapp/dimg/build/stage/before_install'
174
173
  require 'dapp/dimg/build/stage/before_install_artifact'
175
- require 'dapp/dimg/build/stage/ga_archive_dependencies'
176
174
  require 'dapp/dimg/build/stage/ga_archive'
177
- require 'dapp/dimg/build/stage/install/ga_pre_install_patch_dependencies'
178
175
  require 'dapp/dimg/build/stage/install/ga_pre_install_patch'
179
176
  require 'dapp/dimg/build/stage/install/install'
180
- require 'dapp/dimg/build/stage/install/ga_post_install_patch_dependencies'
181
177
  require 'dapp/dimg/build/stage/install/ga_post_install_patch'
182
178
  require 'dapp/dimg/build/stage/after_install_artifact'
183
179
  require 'dapp/dimg/build/stage/before_setup'
184
180
  require 'dapp/dimg/build/stage/before_setup_artifact'
185
- require 'dapp/dimg/build/stage/setup/ga_pre_setup_patch_dependencies'
186
181
  require 'dapp/dimg/build/stage/setup/ga_pre_setup_patch'
187
182
  require 'dapp/dimg/build/stage/setup/setup'
188
- require 'dapp/dimg/build/stage/setup/ga_post_setup_patch_dependencies'
189
183
  require 'dapp/dimg/build/stage/setup/ga_post_setup_patch'
190
184
  require 'dapp/dimg/build/stage/after_setup_artifact'
191
185
  require 'dapp/dimg/build/stage/ga_latest_patch'
@@ -56,9 +56,10 @@ module Dapp
56
56
  super()
57
57
  end
58
58
 
59
- def run_dapp_command(run_method, *args)
60
- dapp = ::Dapp::Dapp.new(*args)
61
- begin
59
+ def run_dapp_command(run_method, options: {}, log_running_time: true)
60
+ dapp = ::Dapp::Dapp.new(options: options)
61
+
62
+ log_dapp_running_time(dapp, ignore: !log_running_time) do
62
63
  if block_given?
63
64
  yield dapp
64
65
  elsif !run_method.nil?
@@ -67,6 +68,17 @@ module Dapp
67
68
  end
68
69
  end
69
70
 
71
+ def log_dapp_running_time(dapp, ignore: false)
72
+ return yield if ignore
73
+
74
+ begin
75
+ start_time = Time.now
76
+ yield
77
+ ensure
78
+ dapp.log_step("Running time #{(Time.now - start_time).round(2)} seconds")
79
+ end
80
+ end
81
+
70
82
  def run(_argv = ARGV)
71
83
  raise
72
84
  end
@@ -186,6 +186,16 @@ module Dapp
186
186
  dimg.git_artifacts.map { |git_artifact| git_artifact.stage_dependencies_checksum(self) }
187
187
  end
188
188
 
189
+ def layer_commit(git_artifact)
190
+ commits[git_artifact] ||= begin
191
+ if image.tagged?
192
+ image.labels["dapp-git-#{git_artifact.paramshash}-commit"]
193
+ else
194
+ git_artifact.latest_commit
195
+ end
196
+ end
197
+ end
198
+
189
199
  def dependencies
190
200
  []
191
201
  end
@@ -202,24 +212,10 @@ module Dapp
202
212
  false
203
213
  end
204
214
 
205
- def prev_g_a_stage
206
- stage = self
207
- until (stage = stage.prev_stage).nil?
208
- return stage if stage.g_a_stage?
209
- end
210
- end
211
-
212
- def next_g_a_stage
213
- stage = self
214
- until (stage = stage.next_stage).nil?
215
- return stage if stage.g_a_stage?
216
- end
217
- end
218
-
219
215
  protected
220
216
 
221
217
  def renew
222
- dependencies_discard
218
+ commits_discard
223
219
  image_reset
224
220
  image_untag! if image_should_be_untagged?
225
221
  end
@@ -301,6 +297,14 @@ module Dapp
301
297
  end
302
298
  end
303
299
  end
300
+
301
+ def commits_discard
302
+ @commits = nil
303
+ end
304
+
305
+ def commits
306
+ @commits ||= {}
307
+ end
304
308
  end # Base
305
309
  end # Stage
306
310
  end # Build
@@ -3,13 +3,24 @@ module Dapp
3
3
  module Build
4
4
  module Stage
5
5
  class GAArchive < GABase
6
+ RESET_COMMIT_MESSAGES = ['[dapp reset]', '[reset dapp]'].freeze
7
+
6
8
  def initialize(dimg, next_stage)
7
- @prev_stage = GAArchiveDependencies.new(dimg, self)
9
+ @prev_stage = BeforeInstallArtifact.new(dimg, self)
8
10
  super
9
11
  end
10
12
 
13
+ def dependencies
14
+ @dependencies ||= [dimg.git_artifacts.map(&:paramshash).join, reset_commits]
15
+ end
16
+
11
17
  protected
12
18
 
19
+ def reset_commits
20
+ regex = Regexp.union(RESET_COMMIT_MESSAGES)
21
+ dimg.git_artifacts.map { |git_artifact| git_artifact.repo.find_commit_id_by_message(regex) }.sort.uniq.compact
22
+ end
23
+
13
24
  def apply_command_method
14
25
  :apply_archive_command
15
26
  end
@@ -3,43 +3,34 @@ module Dapp
3
3
  module Build
4
4
  module Stage
5
5
  class GABase < Base
6
- def dependencies_stage
7
- prev_stage
8
- end
9
-
10
6
  def prepare_image
11
7
  super do
12
8
  image.add_volumes_from dimg.dapp.gitartifact_container
13
9
  image.add_volume "#{dimg.tmp_path('archives')}:#{dimg.container_tmp_path('archives')}:ro"
14
10
  image.add_volume "#{dimg.tmp_path('patches')}:#{dimg.container_tmp_path('patches')}:ro"
15
11
 
16
- dimg.git_artifacts.each { |git_artifact| image.add_command git_artifact.send(apply_command_method, self) }
12
+ dimg.git_artifacts.each do |git_artifact|
13
+ image.add_service_change_label("dapp-git-#{git_artifact.paramshash}-commit".to_sym => git_artifact.latest_commit)
14
+ image.add_command git_artifact.send(apply_command_method, self)
15
+ end
17
16
  end
18
17
  end
19
18
 
20
19
  def empty?
21
- dependencies_stage.empty?
20
+ dimg.git_artifacts.empty? || super
22
21
  end
23
22
 
24
23
  def g_a_stage?
25
24
  true
26
25
  end
27
26
 
28
- def layer_commit(git_artifact)
29
- commits[git_artifact] ||= begin
30
- if dependencies_stage && dependencies_stage.image.tagged?
31
- dependencies_stage.image.labels["dapp-git-#{git_artifact.paramshash}-commit"]
32
- else
33
- git_artifact.latest_commit
34
- end
27
+ def image_should_be_untagged_condition
28
+ return false unless image.tagged?
29
+ dimg.git_artifacts.any? do |git_artifact|
30
+ !git_artifact.repo.commit_exists? layer_commit(git_artifact)
35
31
  end
36
32
  end
37
33
 
38
- def renew
39
- @commits = {}
40
- super
41
- end
42
-
43
34
  protected
44
35
 
45
36
  def should_not_be_detailed?
@@ -53,12 +44,6 @@ module Dapp
53
44
  def apply_command_method
54
45
  :apply_patch_command
55
46
  end
56
-
57
- private
58
-
59
- def commits
60
- @commits ||= {}
61
- end
62
47
  end # GABase
63
48
  end # Stage
64
49
  end # Build
@@ -8,22 +8,23 @@ module Dapp
8
8
  super
9
9
  end
10
10
 
11
- def dependencies_stage
12
- nil
11
+ def renew
12
+ dependencies_discard
13
+ super
13
14
  end
14
15
 
15
16
  def dependencies
16
17
  @dependencies ||= [commit_list, git_artifacts_dev_patch_hashes]
17
18
  end
18
19
 
19
- def layer_commit(git_artifact)
20
- commits[git_artifact] ||= git_artifact.latest_commit
21
- end
22
-
23
20
  def empty?
24
21
  dimg.git_artifacts.empty? || dependencies_empty?
25
22
  end
26
23
 
24
+ def layer_commit(git_artifact)
25
+ commits[git_artifact] ||= git_artifact.latest_commit
26
+ end
27
+
27
28
  private
28
29
 
29
30
  def commit_list
@@ -2,7 +2,7 @@ module Dapp
2
2
  module Dimg
3
3
  module Build
4
4
  module Stage
5
- class GARelatedDependenciesBase < GADependenciesBase
5
+ class GARelatedBase < GABase
6
6
  def dependencies
7
7
  @dependencies ||= dimg.stage_by_name(related_stage_name).context
8
8
  end
@@ -14,7 +14,7 @@ module Dapp
14
14
  def related_stage_name
15
15
  raise
16
16
  end
17
- end # GARelatedDependenciesBase
17
+ end # GARelatedBase
18
18
  end # Stage
19
19
  end # Build
20
20
  end # Dimg
@@ -3,13 +3,17 @@ module Dapp
3
3
  module Build
4
4
  module Stage
5
5
  module Install
6
- class GAPostInstallPatch < GABase
6
+ class GAPostInstallPatch < GARelatedBase
7
7
  include Mod::Group
8
8
 
9
9
  def initialize(dimg, next_stage)
10
- @prev_stage = GAPostInstallPatchDependencies.new(dimg, self)
10
+ @prev_stage = Install.new(dimg, self)
11
11
  super
12
12
  end
13
+
14
+ def related_stage_name
15
+ :before_setup
16
+ end
13
17
  end # GAPostInstallPatch
14
18
  end
15
19
  end # Stage
@@ -3,13 +3,17 @@ module Dapp
3
3
  module Build
4
4
  module Stage
5
5
  module Install
6
- class GAPreInstallPatch < GABase
6
+ class GAPreInstallPatch < GARelatedBase
7
7
  include Mod::Group
8
8
 
9
9
  def initialize(dimg, next_stage)
10
- @prev_stage = GAPreInstallPatchDependencies.new(dimg, self)
10
+ @prev_stage = GAArchive.new(dimg, self)
11
11
  super
12
12
  end
13
+
14
+ def related_stage_name
15
+ :install
16
+ end
13
17
  end # GAPostInstallPatch
14
18
  end
15
19
  end # Stage
@@ -6,10 +6,33 @@ module Dapp
6
6
  class GAPostSetupPatch < GABase
7
7
  include Mod::Group
8
8
 
9
+ MAX_PATCH_SIZE = 1024 * 1024
10
+
9
11
  def initialize(dimg, next_stage)
10
- @prev_stage = GAPostSetupPatchDependencies.new(dimg, self)
12
+ @prev_stage = Setup.new(dimg, self)
11
13
  super
12
14
  end
15
+
16
+ def renew
17
+ dependencies_discard
18
+ super
19
+ end
20
+
21
+ def dependencies
22
+ @dependencies ||= [(changes_size_since_g_a_pre_setup_patch / MAX_PATCH_SIZE).to_i]
23
+ end
24
+
25
+ private
26
+
27
+ def changes_size_since_g_a_pre_setup_patch
28
+ dimg.git_artifacts.map do |git_artifact|
29
+ if git_artifact.repo.commit_exists? prev_stage.layer_commit(git_artifact)
30
+ git_artifact.patch_size(prev_stage.layer_commit(git_artifact), git_artifact.latest_commit)
31
+ else
32
+ 0
33
+ end
34
+ end.reduce(0, :+)
35
+ end
13
36
  end # GAPostSetupPatch
14
37
  end
15
38
  end # Stage
@@ -3,13 +3,17 @@ module Dapp
3
3
  module Build
4
4
  module Stage
5
5
  module Setup
6
- class GAPreSetupPatch < GABase
6
+ class GAPreSetupPatch < GARelatedBase
7
7
  include Mod::Group
8
8
 
9
9
  def initialize(dimg, next_stage)
10
- @prev_stage = GAPreSetupPatchDependencies.new(dimg, self)
10
+ @prev_stage = BeforeSetupArtifact.new(dimg, self)
11
11
  super
12
12
  end
13
+
14
+ def related_stage_name
15
+ :setup
16
+ end
13
17
  end # GAPrePatch
14
18
  end
15
19
  end # Stage
@@ -6,8 +6,8 @@ module Dapp::Dimg::CLI
6
6
  run_dapp_command(run_method, options: cli_options(dimgs_patterns: cli_arguments))
7
7
  end
8
8
 
9
- def run_dapp_command(run_method, *args)
10
- super(nil, *args) do |dapp|
9
+ def run_dapp_command(run_method, options: {}, log_running_time: true)
10
+ super(nil, options: options, log_running_time: log_running_time) do |dapp|
11
11
  begin
12
12
  dapp.host_docker_login
13
13
  if block_given?
@@ -51,7 +51,7 @@ BANNER
51
51
  index = filtered_args.index('--') || filtered_args.count
52
52
  docker_options = index.nonzero? ? filtered_args.slice(0..index - 1) : []
53
53
  command = filtered_args.slice(index + 1..-1) || []
54
- run_dapp_command(nil, options: cli_options(dimgs_patterns: patterns)) do |dapp|
54
+ run_dapp_command(nil, options: cli_options(dimgs_patterns: patterns), log_running_time: false) do |dapp|
55
55
  dapp.run(docker_options, command)
56
56
  end
57
57
  end
@@ -3,8 +3,8 @@ module Dapp::Dimg::CLI
3
3
  class Dimg < ::Dapp::CLI
4
4
  class Stages < ::Dapp::CLI
5
5
  class Base < Base
6
- def run_dapp_command(run_command, options: {})
7
- super(run_command, options: options.merge(verbose: true))
6
+ def run_dapp_command(run_command, options: {}, log_running_time: true)
7
+ super(run_command, options: options.merge(verbose: true), log_running_time: log_running_time)
8
8
  end
9
9
  end
10
10
  end
@@ -16,7 +16,7 @@ BANNER
16
16
  def run(argv = ARGV)
17
17
  self.class.parse_options(self, argv)
18
18
  tag = self.class.required_argument(self, 'tag')
19
- run_dapp_command(nil, options: cli_options(dimgs_patterns: cli_arguments)) do
19
+ run_dapp_command(nil, options: cli_options(dimgs_patterns: cli_arguments)) do |dapp|
20
20
  dapp.public_send(run_method, tag)
21
21
  end
22
22
  end
@@ -417,11 +417,11 @@ module Dapp
417
417
  end
418
418
 
419
419
  def patch_stage_commits(stage)
420
- [stage.prev_g_a_stage.layer_commit(self), stage.layer_commit(self)]
420
+ [stage.prev_stage.layer_commit(self), stage.layer_commit(self)]
421
421
  end
422
422
 
423
423
  def dev_patch_stage_commits(stage)
424
- [stage.prev_g_a_stage.layer_commit(self), nil]
424
+ [stage.prev_stage.layer_commit(self), nil]
425
425
  end
426
426
 
427
427
  def any_changes?(from_commit, to_commit)
@@ -35,7 +35,7 @@ BANNER
35
35
  def run(argv = ARGV)
36
36
  self.class.parse_options(self, argv)
37
37
 
38
- run_dapp_command(nil, options: cli_options) do |dapp|
38
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
39
39
  repo = if not cli_arguments[0].nil?
40
40
  self.class.required_argument(self, 'repo')
41
41
  else
@@ -44,7 +44,7 @@ BANNER
44
44
  def run(argv = ARGV)
45
45
  self.class.parse_options(self, argv)
46
46
 
47
- run_dapp_command(nil, options: cli_options) do |dapp|
47
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
48
48
  repo = if not cli_arguments[0].nil?
49
49
  self.class.required_argument(self, 'repo')
50
50
  else
@@ -17,7 +17,7 @@ BANNER
17
17
  def run(argv = ARGV)
18
18
  self.class.parse_options(self, argv)
19
19
  file_path = self.class.required_argument(self, 'FILE_PATH')
20
- run_dapp_command(nil, options: cli_options) do |dapp|
20
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
21
21
  dapp.public_send(run_method, file_path)
22
22
  end
23
23
  end
@@ -26,7 +26,7 @@ BANNER
26
26
  self.class.required_argument(self, 'FILE_PATH')
27
27
  end
28
28
  end
29
- run_dapp_command(nil, options: cli_options) do |dapp|
29
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
30
30
  dapp.public_send(run_method, file_path)
31
31
  end
32
32
  end
@@ -21,7 +21,7 @@ BANNER
21
21
  def run(argv = ARGV)
22
22
  self.class.parse_options(self, argv)
23
23
  file_path = cli_arguments.empty? ? nil : cli_arguments.first
24
- run_dapp_command(nil, options: cli_options) do |dapp|
24
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
25
25
  dapp.public_send(run_method, file_path)
26
26
  end
27
27
  end
@@ -8,6 +8,9 @@ Usage:
8
8
 
9
9
  Options:
10
10
  BANNER
11
+ def run_dapp_command(run_method, options: {}, log_running_time: false)
12
+ super(run_method, options: options, log_running_time: log_running_time)
13
+ end
11
14
  end
12
15
  end
13
16
  end
@@ -16,7 +16,7 @@ BANNER
16
16
 
17
17
  def run(argv = ARGV)
18
18
  self.class.parse_options(self, argv)
19
- run_dapp_command(nil, options: cli_options) do |dapp|
19
+ run_dapp_command(nil, options: cli_options, log_running_time: false) do |dapp|
20
20
  dapp.public_send(run_method, *cli_arguments)
21
21
  end
22
22
  end
data/lib/dapp/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = '0.19.5'.freeze
3
- BUILD_CACHE_VERSION = 21
2
+ VERSION = '0.19.6'.freeze
3
+ BUILD_CACHE_VERSION = 22
4
4
  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.19.5
4
+ version: 0.19.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: 2017-11-18 00:00:00.000000000 Z
11
+ date: 2017-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -502,24 +502,18 @@ files:
502
502
  - lib/dapp/dimg/build/stage/docker_instructions.rb
503
503
  - lib/dapp/dimg/build/stage/from.rb
504
504
  - lib/dapp/dimg/build/stage/ga_archive.rb
505
- - lib/dapp/dimg/build/stage/ga_archive_dependencies.rb
506
505
  - lib/dapp/dimg/build/stage/ga_artifact_patch.rb
507
506
  - lib/dapp/dimg/build/stage/ga_base.rb
508
- - lib/dapp/dimg/build/stage/ga_dependencies_base.rb
509
507
  - lib/dapp/dimg/build/stage/ga_latest_patch.rb
510
- - lib/dapp/dimg/build/stage/ga_related_dependencies_base.rb
508
+ - lib/dapp/dimg/build/stage/ga_related_base.rb
511
509
  - lib/dapp/dimg/build/stage/import_artifact.rb
512
510
  - lib/dapp/dimg/build/stage/install/ga_post_install_patch.rb
513
- - lib/dapp/dimg/build/stage/install/ga_post_install_patch_dependencies.rb
514
511
  - lib/dapp/dimg/build/stage/install/ga_pre_install_patch.rb
515
- - lib/dapp/dimg/build/stage/install/ga_pre_install_patch_dependencies.rb
516
512
  - lib/dapp/dimg/build/stage/install/install.rb
517
513
  - lib/dapp/dimg/build/stage/mod/group.rb
518
514
  - lib/dapp/dimg/build/stage/mod/logging.rb
519
515
  - lib/dapp/dimg/build/stage/setup/ga_post_setup_patch.rb
520
- - lib/dapp/dimg/build/stage/setup/ga_post_setup_patch_dependencies.rb
521
516
  - lib/dapp/dimg/build/stage/setup/ga_pre_setup_patch.rb
522
- - lib/dapp/dimg/build/stage/setup/ga_pre_setup_patch_dependencies.rb
523
517
  - lib/dapp/dimg/build/stage/setup/setup.rb
524
518
  - lib/dapp/dimg/builder.rb
525
519
  - lib/dapp/dimg/builder/base.rb
@@ -1,27 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- class GAArchiveDependencies < GADependenciesBase
6
- RESET_COMMIT_MESSAGES = ['[dapp reset]', '[reset dapp]'].freeze
7
-
8
- def initialize(dimg, next_stage)
9
- @prev_stage = BeforeInstallArtifact.new(dimg, self)
10
- super
11
- end
12
-
13
- def dependencies
14
- @dependencies ||= [dimg.git_artifacts.map(&:paramshash).join, reset_commits]
15
- end
16
-
17
- protected
18
-
19
- def reset_commits
20
- regex = Regexp.union(RESET_COMMIT_MESSAGES)
21
- dimg.git_artifacts.map { |git_artifact| git_artifact.repo.find_commit_id_by_message(regex) }.sort.uniq.compact
22
- end
23
- end # GAArchiveDependencies
24
- end # Stage
25
- end # Build
26
- end # Dimg
27
- end # Dapp
@@ -1,28 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- class GADependenciesBase < Base
6
- def prepare_image
7
- super do
8
- dimg.git_artifacts.each do |git_artifact|
9
- image.add_service_change_label("dapp-git-#{git_artifact.paramshash}-commit".to_sym => git_artifact.latest_commit)
10
- end
11
- end
12
- end
13
-
14
- def empty?
15
- dimg.git_artifacts.empty? || super
16
- end
17
-
18
- def image_should_be_untagged_condition
19
- return false unless image.tagged?
20
- dimg.git_artifacts.any? do |git_artifact|
21
- !git_artifact.repo.commit_exists? image.labels["dapp-git-#{git_artifact.paramshash}-commit"]
22
- end
23
- end
24
- end # GADependenciesBase
25
- end # Stage
26
- end # Build
27
- end # Dimg
28
- end # Dapp
@@ -1,22 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- module Install
6
- class GAPostInstallPatchDependencies < GARelatedDependenciesBase
7
- include Mod::Group
8
-
9
- def initialize(dimg, next_stage)
10
- @prev_stage = Install.new(dimg, self)
11
- super
12
- end
13
-
14
- def related_stage_name
15
- :before_setup
16
- end
17
- end # GAPostInstallPatchDependencies
18
- end
19
- end # Stage
20
- end # Build
21
- end # Dimg
22
- end # Dapp
@@ -1,22 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- module Install
6
- class GAPreInstallPatchDependencies < GARelatedDependenciesBase
7
- include Mod::Group
8
-
9
- def initialize(dimg, next_stage)
10
- @prev_stage = GAArchive.new(dimg, self)
11
- super
12
- end
13
-
14
- def related_stage_name
15
- :install
16
- end
17
- end # GAPreInstallPatchDependencies
18
- end
19
- end # Stage
20
- end # Build
21
- end # Dimg
22
- end # Dapp
@@ -1,36 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- module Setup
6
- class GAPostSetupPatchDependencies < GADependenciesBase
7
- include Mod::Group
8
-
9
- MAX_PATCH_SIZE = 1024 * 1024
10
-
11
- def initialize(dimg, next_stage)
12
- @prev_stage = Setup.new(dimg, self)
13
- super
14
- end
15
-
16
- def dependencies
17
- @dependencies ||= [(changes_size_since_g_a_pre_setup_patch / MAX_PATCH_SIZE).to_i]
18
- end
19
-
20
- private
21
-
22
- def changes_size_since_g_a_pre_setup_patch
23
- dimg.git_artifacts.map do |git_artifact|
24
- if git_artifact.repo.commit_exists? prev_g_a_stage.layer_commit(git_artifact)
25
- git_artifact.patch_size(prev_g_a_stage.layer_commit(git_artifact), git_artifact.latest_commit)
26
- else
27
- 0
28
- end
29
- end.reduce(0, :+)
30
- end
31
- end # GAPostSetupPatchDependencies
32
- end
33
- end # Stage
34
- end # Build
35
- end # Dimg
36
- end # Dapp
@@ -1,22 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- module Build
4
- module Stage
5
- module Setup
6
- class GAPreSetupPatchDependencies < GARelatedDependenciesBase
7
- include Mod::Group
8
-
9
- def initialize(dimg, next_stage)
10
- @prev_stage = BeforeSetupArtifact.new(dimg, self)
11
- super
12
- end
13
-
14
- def related_stage_name
15
- :setup
16
- end
17
- end # GAPreSetupPatchDependencies
18
- end
19
- end # Stage
20
- end # Build
21
- end # Dimg
22
- end # Dapp