dapp 0.25.6 → 0.25.7

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: 38693a8d1134d6e580ae6f714082d7db743e5a2d
4
- data.tar.gz: 94bbff9ef8274b6cdcddcae4906cfee521a79d11
3
+ metadata.gz: aef8ea2f6a2d8c3d4082b084d4b0233c26ffe33f
4
+ data.tar.gz: fd5c263de25eccd3f85276b8bbd333cef39b9857
5
5
  SHA512:
6
- metadata.gz: bc3004df4e897106044271927384174097301ba1b0678fa65f6920862a5c6575f9194fc5a92cd10fd0a0c7f449a37fff5c62f47abd1f29e2ef3edd3f663017e5
7
- data.tar.gz: 5c43c9458405b6b7d512cd969594c9d0e10d6395d89e828cb5c3b8d315354988b730e79bf2114c95565d44baf8d27da6839482ba33d3c7f5ff7cdc748f10705c
6
+ metadata.gz: 515cfb5a3ea8ab80506bede101b128af04504faa68c9688b876be23f846407dd601dc8505a40ee5fe72e24de88011a16d362347bcd654cd02dd2f8eabd75d2f2
7
+ data.tar.gz: df790680c28f11d83cd562f1357fb9e7209c33e6ab58ab5c81c40a1483180b1d86222f4e54016adadac83fa695eb32fe0c491f0620d1bce8490c4fca88ec99d6
@@ -189,8 +189,10 @@ module Dapp
189
189
  commits[git_artifact] ||= begin
190
190
  if image.built?
191
191
  image.labels[dimg.dapp.dimgstage_g_a_commit_label(git_artifact.paramshash)]
192
- else
192
+ elsif g_a_stage? && !empty?
193
193
  git_artifact.latest_commit
194
+ elsif prev_stage
195
+ prev_stage.layer_commit(git_artifact)
194
196
  end
195
197
  end
196
198
  end
@@ -10,7 +10,7 @@ module Dapp
10
10
  image.add_volume "#{dimg.tmp_path('patches')}:#{dimg.container_tmp_path('patches')}:ro"
11
11
 
12
12
  dimg.git_artifacts.each do |git_artifact|
13
- image.add_service_change_label(dimg.dapp.dimgstage_g_a_commit_label(git_artifact.paramshash).to_sym => git_artifact.latest_commit)
13
+ image.add_service_change_label(dimg.dapp.dimgstage_g_a_commit_label(git_artifact.paramshash).to_sym => layer_commit(git_artifact))
14
14
  image.add_command git_artifact.send(apply_command_method, self)
15
15
  end
16
16
  end
@@ -28,7 +28,9 @@ module Dapp
28
28
  private
29
29
 
30
30
  def commit_list
31
- dimg.git_artifacts.map { |git_artifact| layer_commit(git_artifact) }
31
+ dimg.git_artifacts
32
+ .select { |ga| ga.repo.commit_exists?(prev_stage.layer_commit(ga)) && ga.patch_any_changes?(self) }
33
+ .map(&method(:layer_commit))
32
34
  end
33
35
 
34
36
  def git_artifacts_dev_patch_hashes
@@ -35,7 +35,6 @@ module Dapp
35
35
  end
36
36
 
37
37
  def image_delete(tag)
38
- image_blobs(tag).each { |hash| blob_delete(hash.values.first) }
39
38
  api_request(repo_suffix, "/manifests/#{image_digest(tag)}",
40
39
  method: :delete,
41
40
  expects: [202, 404],
@@ -54,10 +53,6 @@ module Dapp
54
53
  headers: { Accept: 'application/vnd.docker.distribution.manifest.v2+json' }).headers['Docker-Content-Digest']
55
54
  end
56
55
 
57
- def image_blobs(tag)
58
- manifest_v1(tag)['fsLayers']
59
- end
60
-
61
56
  def manifest_v1(tag)
62
57
  api_request(repo_suffix, "/manifests/#{tag}")
63
58
  end
@@ -67,11 +62,6 @@ module Dapp
67
62
  headers: { Accept: 'application/vnd.docker.distribution.manifest.v2+json' })
68
63
  end
69
64
 
70
- def blob_delete(id)
71
- api_request(repo_suffix, "/blobs/#{id}",
72
- method: :delete, expects: [202, 404])
73
- end
74
-
75
65
  def api_request(*uri, **options)
76
66
  JSON.load(raw_api_request(*uri, **options).body)
77
67
  end
@@ -104,12 +104,12 @@ module Dapp
104
104
 
105
105
  def patches(from, to, paths: [], exclude_paths: [], **kwargs)
106
106
  diff(from, to, **kwargs).patches.select do |patch|
107
- ignore_patch?(patch, paths: paths, exclude_paths: exclude_paths)
107
+ !ignore_patch?(patch, paths: paths, exclude_paths: exclude_paths)
108
108
  end
109
109
  end
110
110
 
111
111
  def ignore_patch?(patch, paths: [], exclude_paths: [])
112
- !ignore_path?(patch.delta.new_file[:path], paths: paths, exclude_paths: exclude_paths)
112
+ ignore_path?(patch.delta.new_file[:path], paths: paths, exclude_paths: exclude_paths)
113
113
  end
114
114
 
115
115
  def entries(commit, paths: [], exclude_paths: [])
@@ -48,9 +48,9 @@ module Dapp
48
48
  delta_new_file = patch.delta.new_file
49
49
  args = [delta_new_file[:path], paths: paths, exclude_paths: exclude_paths]
50
50
  if nested_git_repository_mode?(delta_new_file[:mode])
51
- !ignore_directory?(*args)
51
+ ignore_directory?(*args)
52
52
  else
53
- !ignore_path?(*args)
53
+ ignore_path?(*args)
54
54
  end
55
55
  end
56
56
 
data/lib/dapp/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.25.6"
3
- BUILD_CACHE_VERSION = 26.1
2
+ VERSION = "0.25.7"
3
+ BUILD_CACHE_VERSION = 26.2
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.25.6
4
+ version: 0.25.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-22 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout