dapp 0.15.2 → 0.16.0
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/push.rb +7 -0
- data/lib/dapp/dimg/dimg.rb +1 -1
- data/lib/dapp/dimg/image/docker.rb +10 -2
- 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: 63a283e9c26d03971a7ce417975d2769955bd352
|
4
|
+
data.tar.gz: 3dfee7cbdf9fcc6e15ecdde2ea46a757c4cad41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6e76250e151bc3b531c3378762e95e48c771ca9f2d33b21176da294c8e80adedb1cfd3668cde383366d534239fadd83178c5b274585381c0d3476579f8d6c5
|
7
|
+
data.tar.gz: b9e3dd5df6248d14ec6a775280f6c52295d7f7f878b6441c76de4d90fdb082bbf65c1d65a2a29235e6b3cbd6414486bcc6b67fc243d16862073d49ae076dc6a5
|
@@ -4,6 +4,8 @@ module Dapp
|
|
4
4
|
module Command
|
5
5
|
module Push
|
6
6
|
def push
|
7
|
+
#require 'ruby-prof'
|
8
|
+
#RubyProf.start
|
7
9
|
repo = option_repo
|
8
10
|
validate_repo_name!(repo)
|
9
11
|
log_step_with_indent(:stages) { stages_push } if with_stages?
|
@@ -14,8 +16,13 @@ module Dapp
|
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
19
|
+
# FIXME: rework images cache, then profile
|
20
|
+
#result = RubyProf.stop
|
21
|
+
#printer = RubyProf::MultiPrinter.new(result)
|
22
|
+
#printer.print(path: '/tmp/testdapp.push.profile', profile: 'profile')
|
17
23
|
end
|
18
24
|
|
25
|
+
|
19
26
|
protected
|
20
27
|
|
21
28
|
def with_stages?
|
data/lib/dapp/dimg/dimg.rb
CHANGED
@@ -83,7 +83,7 @@ module Dapp
|
|
83
83
|
dapp.log_state(image_name, state: dapp.t(code: 'state.push'), styles: { status: :success })
|
84
84
|
else
|
85
85
|
dapp.lock("image.#{hashsum image_name}") do
|
86
|
-
::Dapp::Dimg::Image::Stage.
|
86
|
+
::Dapp::Dimg::Image::Stage.cache.delete(image_name)
|
87
87
|
dapp.log_process(image_name, process: dapp.t(code: 'status.process.pushing')) do
|
88
88
|
image.export!(image_name)
|
89
89
|
end
|
@@ -23,7 +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
|
-
|
26
|
+
cache.delete(name)
|
27
27
|
end
|
28
28
|
|
29
29
|
def push!
|
@@ -89,7 +89,12 @@ module Dapp
|
|
89
89
|
|
90
90
|
def tag!(id:, tag:, verbose: false, quiet: false)
|
91
91
|
::Dapp::Dapp.shellout!("#{::Dapp::Dapp.host_docker} tag #{id} #{tag}", verbose: verbose, quiet: quiet)
|
92
|
-
|
92
|
+
|
93
|
+
if cache_entry = cache.values.find {|v| v[:id] == id}
|
94
|
+
cache[tag] = cache_entry
|
95
|
+
else
|
96
|
+
cache_reset
|
97
|
+
end
|
93
98
|
end
|
94
99
|
|
95
100
|
def save!(image_or_images, file_path, verbose: false, quiet: false)
|
@@ -106,6 +111,8 @@ module Dapp
|
|
106
111
|
end
|
107
112
|
|
108
113
|
def cache_reset(name = '')
|
114
|
+
# FIXME: rework images cache, then delete time measure
|
115
|
+
#t = Time.now
|
109
116
|
cache.delete(name)
|
110
117
|
::Dapp::Dapp.shellout!("#{::Dapp::Dapp.host_docker} images --format='{{.Repository}}:{{.Tag}};{{.ID}};{{.CreatedAt}};{{.Size}}' --no-trunc #{name}")
|
111
118
|
.stdout
|
@@ -132,6 +139,7 @@ module Dapp
|
|
132
139
|
end
|
133
140
|
cache[name] = { id: id, created_at: created_at, size: size }
|
134
141
|
end
|
142
|
+
#p [:cache_reset, name, :took, Time.now - t]
|
135
143
|
end
|
136
144
|
end
|
137
145
|
end # Docker
|
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.
|
4
|
+
version: 0.16.0
|
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-10-
|
11
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|