dapp 0.18.0 → 0.18.1
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/dimg/dapp/command/build_context/export.rb +2 -2
- data/lib/dapp/dimg/dapp/command/build_context/import.rb +2 -2
- data/lib/dapp/dimg/dapp/command/common.rb +1 -1
- data/lib/dapp/dimg/dapp/command/mrproper.rb +2 -0
- data/lib/dapp/dimg/dapp/command/stages/cleanup_local.rb +1 -1
- data/lib/dapp/dimg/dapp/command/stages/flush_repo.rb +4 -4
- data/lib/dapp/dimg/image/argument.rb +1 -1
- data/lib/dapp/dimg/image/docker.rb +26 -3
- data/lib/dapp/dimg/image/stage.rb +1 -2
- data/lib/dapp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b36446e8acb49a7145d9787e3e13e833c1c35cb80ca137210131c9f2bdc8e52c
|
4
|
+
data.tar.gz: 57a6b73ee8736d0218a594b7e282b9260a03ef1ed493b92b6696ec2859003032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24426a46adede038593a7f2fc2ded64e52ad0520b77b26e3f26db64f6efab92d65992ca19e77e20a21a767865fcd17721fc1a3fc401dc8316100fa4625011452
|
7
|
+
data.tar.gz: bcfcf731bf3cf1fc09f8bae99136dc2fcc3a3465cf044eece3a8f05367fbca8de8a871c51d71b0073f1d2b1624a6af6b8f6e2d096f879e5def0a3ff5db495394
|
@@ -18,7 +18,7 @@ module Dapp
|
|
18
18
|
end.flatten
|
19
19
|
|
20
20
|
log_secondary_process(:images, short: true) do
|
21
|
-
Image::Docker.save!(context_images_names, build_context_images_tar, verbose: true, quiet: log_quiet?)
|
21
|
+
Image::Docker.save!(context_images_names, build_context_images_tar, verbose: true, quiet: log_quiet?) unless dry_run?
|
22
22
|
end unless context_images_names.empty?
|
23
23
|
end
|
24
24
|
end
|
@@ -40,7 +40,7 @@ module Dapp
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end unless dry_run?
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -19,7 +19,7 @@ module Dapp
|
|
19
19
|
log_secondary_process(:images, short: true) do
|
20
20
|
lock("#{name}.images") do
|
21
21
|
Image::Docker.load!(build_context_images_tar, verbose: true, quiet: log_quiet?)
|
22
|
-
end
|
22
|
+
end unless dry_run?
|
23
23
|
end
|
24
24
|
else
|
25
25
|
log_warning(desc: { code: :context_archive_not_found, data: { path: build_context_images_tar } })
|
@@ -44,7 +44,7 @@ module Dapp
|
|
44
44
|
File.chmod(header.mode, path)
|
45
45
|
end
|
46
46
|
end
|
47
|
-
end
|
47
|
+
end unless dry_run?
|
48
48
|
end
|
49
49
|
else
|
50
50
|
log_warning(desc: { code: :context_archive_not_found, data: { path: build_context_build_tar } })
|
@@ -92,7 +92,7 @@ module Dapp
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def image_dapp_artifacts_label(image_id)
|
95
|
-
select_dapp_artifacts_ids(::Dapp::Dimg::Image::Docker.image_config_option(image_id: image_id, option: '
|
95
|
+
select_dapp_artifacts_ids(::Dapp::Dimg::Image::Docker.image_config_option(image_id: image_id, option: 'Labels') || {})
|
96
96
|
end
|
97
97
|
|
98
98
|
def image_parent(image_id)
|
@@ -4,10 +4,10 @@ module Dapp
|
|
4
4
|
module Command
|
5
5
|
module Stages
|
6
6
|
module FlushRepo
|
7
|
-
def stages_flush_repo
|
8
|
-
lock_repo(
|
9
|
-
log_step_with_indent(
|
10
|
-
registry = registry(
|
7
|
+
def stages_flush_repo
|
8
|
+
lock_repo(option_repo) do
|
9
|
+
log_step_with_indent(option_repo) do
|
10
|
+
registry = registry(option_repo)
|
11
11
|
repo_dimgs, repo_stages = repo_dimgs_and_cache(registry)
|
12
12
|
repo_dimgs.merge(repo_stages).keys.each { |image_tag| delete_repo_image(registry, image_tag) }
|
13
13
|
end
|
@@ -97,7 +97,7 @@ module Dapp
|
|
97
97
|
def from_change_options
|
98
98
|
return {} if from.nil?
|
99
99
|
[:entrypoint, :cmd].each_with_object({}) do |option, options|
|
100
|
-
options[option] =
|
100
|
+
options[option] = from.config_option(option.to_s.capitalize) || []
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
@@ -23,6 +23,7 @@ module Dapp
|
|
23
23
|
def untag!
|
24
24
|
raise Error::Build, code: :image_already_untagged, data: { name: name } unless tagged?
|
25
25
|
dapp.shellout!("#{dapp.host_docker} rmi #{name}")
|
26
|
+
image_config_delete(id)
|
26
27
|
self.class.cache.delete(name)
|
27
28
|
end
|
28
29
|
|
@@ -55,15 +56,36 @@ module Dapp
|
|
55
56
|
cache[:size]
|
56
57
|
end
|
57
58
|
|
58
|
-
def
|
59
|
-
|
60
|
-
|
59
|
+
def config_option(option)
|
60
|
+
raise Error::Build, code: :image_not_exist, data: { name: name } if built_id.nil?
|
61
|
+
self.class.image_config_option(image_id: built_id, option: option)
|
61
62
|
end
|
62
63
|
|
63
64
|
def cache_reset
|
64
65
|
self.class.cache_reset(name)
|
65
66
|
end
|
66
67
|
|
68
|
+
class << self
|
69
|
+
def image_config(image_id)
|
70
|
+
image_configs[image_id] ||= begin
|
71
|
+
output = ::Dapp::Dapp.shellout!("#{::Dapp::Dapp.host_docker} inspect --format='{{json .Config}}' #{image_id}").stdout.strip
|
72
|
+
JSON.parse(output)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def image_config_option(image_id:, option:)
|
77
|
+
image_config(image_id)[option]
|
78
|
+
end
|
79
|
+
|
80
|
+
def image_config_delete(image_id)
|
81
|
+
image_configs.delete(image_id)
|
82
|
+
end
|
83
|
+
|
84
|
+
def image_configs
|
85
|
+
@image_configs ||= {}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
67
89
|
protected
|
68
90
|
|
69
91
|
def cache
|
@@ -138,6 +160,7 @@ module Dapp
|
|
138
160
|
number * (1000**coef)
|
139
161
|
end
|
140
162
|
cache[name] = { id: id, created_at: created_at, size: size }
|
163
|
+
image_config_delete(id)
|
141
164
|
end
|
142
165
|
#p [:cache_reset, name, :took, Time.now - t]
|
143
166
|
end
|
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.18.
|
4
|
+
version: 0.18.1
|
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-
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -706,7 +706,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
706
706
|
version: 2.5.0
|
707
707
|
requirements: []
|
708
708
|
rubyforge_project:
|
709
|
-
rubygems_version: 2.7.
|
709
|
+
rubygems_version: 2.7.1
|
710
710
|
signing_key:
|
711
711
|
specification_version: 4
|
712
712
|
summary: Build docker packaged apps using chef or shell
|