dapp 0.7.21 → 0.7.22
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/config/en/common.yml +2 -2
- data/config/en/net_status.yml +2 -1
- data/lib/dapp/build/stage/artifact_default.rb +3 -3
- data/lib/dapp/build/stage/mod/logging.rb +4 -4
- data/lib/dapp/config/directive/artifact_base.rb +8 -4
- data/lib/dapp/git_repo/own.rb +2 -0
- data/lib/dapp/git_repo/remote.rb +3 -1
- data/lib/dapp/image/docker.rb +12 -1
- 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: e1d331bc07f3e624682ffd414440632af1539623
|
4
|
+
data.tar.gz: fb78b3ad52f34339480699c0732f3257e591c679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2645b1233f00e1cdf09f22f42da53659df25b187e89e93541eb9a35f281bda3e1fa860396e36404671ddd5953c23e11677a41bf07a6a400abfc7c067304c7e6c
|
7
|
+
data.tar.gz: d9360bf403e44a3c5dd96bd3d65c4c036b9e74c6f6f256f78c0aa4c34527e5274fee9b5d9bf343d2211785061b38f241d605ebb0e9f7d812c295586341290bea
|
data/config/en/common.yml
CHANGED
@@ -4,8 +4,8 @@ en:
|
|
4
4
|
signature: "signature: %{signature}"
|
5
5
|
info:
|
6
6
|
created_at: "date: %{value}"
|
7
|
-
|
8
|
-
difference: "difference: %{
|
7
|
+
mb_size: "size: %{mb} MB"
|
8
|
+
difference: "difference: %{mb} MB"
|
9
9
|
commands: "commands:"
|
10
10
|
instructions: "instructions:"
|
11
11
|
container:
|
data/config/en/net_status.yml
CHANGED
@@ -64,6 +64,7 @@ en:
|
|
64
64
|
page_not_found: "Registry `%{registry}`: page `%{url}` not found!"
|
65
65
|
user_not_authorized: 'Registry `%{registry}`: user not authorized!'
|
66
66
|
rugged:
|
67
|
-
|
67
|
+
rugged_remote_error: "Remote git repo `%{url}`: `%{message}`!"
|
68
|
+
local_git_repository_does_not_exist: "Local git repo: doesn't exist!"
|
68
69
|
lock:
|
69
70
|
timeout: "Could not obtain lock for `%{name}` within %{timeout} seconds"
|
@@ -39,9 +39,9 @@ module Dapp
|
|
39
39
|
copy_files = proc do |from_, path_ = ''|
|
40
40
|
"if [[ -d #{File.join(from_, path_)} ]] || [[ -f #{File.join(from_, path_)} ]]; then " \
|
41
41
|
"#{dimg.project.find_bin} #{File.join(from_, path_)} #{excludes} -type f -exec " \
|
42
|
-
"#{dimg.project.bash_bin} -ec '#{dimg.project.install_bin} -D #{credentials} {} " \
|
43
|
-
"#{File.join(to,
|
44
|
-
"#{dimg.project.sed_bin} -e \"s
|
42
|
+
"#{dimg.project.bash_bin} -ec '#{dimg.project.install_bin} -D #{credentials} \"{}\" " \
|
43
|
+
"\"#{File.join(to, "$(echo \"{}\" | " \
|
44
|
+
"#{dimg.project.sed_bin} -e \"s/^#{from_.gsub('/', '\\/')}\\///g\")")}\"' \\; ;" \
|
45
45
|
'fi'
|
46
46
|
end
|
47
47
|
|
@@ -45,13 +45,13 @@ module Dapp
|
|
45
45
|
|
46
46
|
def log_image_size
|
47
47
|
if !prev_stage.nil? && from_image.tagged?
|
48
|
-
|
48
|
+
bytes = image.size - from_image.size
|
49
49
|
code = 'image.info.difference'
|
50
50
|
else
|
51
|
-
|
52
|
-
code = 'image.info.
|
51
|
+
bytes = image.size
|
52
|
+
code = 'image.info.mb_size'
|
53
53
|
end
|
54
|
-
dimg.project.log_info dimg.project.t(code: code, data: {
|
54
|
+
dimg.project.log_info dimg.project.t(code: code, data: { mb: (bytes / 1000 / 1000).round(3) })
|
55
55
|
end
|
56
56
|
|
57
57
|
def log_image_commands
|
@@ -26,7 +26,7 @@ module Dapp
|
|
26
26
|
|
27
27
|
def initialize(cwd = '/', **kwargs, &blk)
|
28
28
|
raise Error::Config, code: :export_cwd_absolute_path_required unless Pathname(cwd).absolute?
|
29
|
-
@_cwd = cwd
|
29
|
+
@_cwd = path_format(cwd)
|
30
30
|
@_include_paths ||= []
|
31
31
|
@_exclude_paths ||= []
|
32
32
|
|
@@ -48,17 +48,17 @@ module Dapp
|
|
48
48
|
|
49
49
|
def to(absolute_path)
|
50
50
|
raise Error::Config, code: :export_to_absolute_path_required unless Pathname(absolute_path).absolute?
|
51
|
-
@_to = absolute_path
|
51
|
+
@_to = path_format(absolute_path)
|
52
52
|
end
|
53
53
|
|
54
54
|
def include_paths(*relative_paths)
|
55
55
|
raise Error::Config, code: :export_include_paths_relative_path_required unless relative_paths.all? { |path| Pathname(path).relative? }
|
56
|
-
_include_paths.concat(relative_paths)
|
56
|
+
_include_paths.concat(relative_paths.map(&method(:path_format)))
|
57
57
|
end
|
58
58
|
|
59
59
|
def exclude_paths(*relative_paths)
|
60
60
|
raise Error::Config, code: :export_exclude_paths_relative_path_required unless relative_paths.all? { |path| Pathname(path).relative? }
|
61
|
-
_exclude_paths.concat(relative_paths)
|
61
|
+
_exclude_paths.concat(relative_paths.map(&method(:path_format)))
|
62
62
|
end
|
63
63
|
|
64
64
|
def owner(owner)
|
@@ -72,6 +72,10 @@ module Dapp
|
|
72
72
|
def validate!
|
73
73
|
raise Error::Config, code: :export_to_required if _to.nil?
|
74
74
|
end
|
75
|
+
|
76
|
+
def path_format(path)
|
77
|
+
path.chomp('/')
|
78
|
+
end
|
75
79
|
end
|
76
80
|
|
77
81
|
protected
|
data/lib/dapp/git_repo/own.rb
CHANGED
data/lib/dapp/git_repo/remote.rb
CHANGED
@@ -11,7 +11,9 @@ module Dapp
|
|
11
11
|
begin
|
12
12
|
Rugged::Repository.clone_at(url, path, bare: true)
|
13
13
|
rescue Rugged::NetworkError => e
|
14
|
-
raise Error::Rugged, code: :
|
14
|
+
raise Error::Rugged, code: :rugged_remote_error, data: { message: e.message, url: url }
|
15
|
+
rescue Rugged::SslError => e
|
16
|
+
raise Error::Rugged, code: :rugged_remote_error, data: { message: e.message, url: url }
|
15
17
|
end
|
16
18
|
end unless File.directory?(path)
|
17
19
|
end
|
data/lib/dapp/image/docker.rb
CHANGED
@@ -90,7 +90,18 @@ module Dapp
|
|
90
90
|
def cache_reset(name = '')
|
91
91
|
cache.delete(name)
|
92
92
|
Project.shellout!("docker images --format='{{.Repository}}:{{.Tag}};{{.ID}};{{.CreatedAt}};{{.Size}}' --no-trunc #{name}").stdout.lines.each do |l|
|
93
|
-
name, id, created_at,
|
93
|
+
name, id, created_at, size_field = l.split(';')
|
94
|
+
size = begin
|
95
|
+
number, unit = size_field.split
|
96
|
+
coef = case unit.to_s.downcase
|
97
|
+
when 'b' then return number.to_f
|
98
|
+
when 'kb' then 1
|
99
|
+
when 'mb' then 2
|
100
|
+
when 'gb' then 3
|
101
|
+
when 'tb' then 4
|
102
|
+
end
|
103
|
+
number.to_f * (1000 ** coef)
|
104
|
+
end
|
94
105
|
cache[name] = { id: id, created_at: created_at, size: size }
|
95
106
|
end
|
96
107
|
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.7.
|
4
|
+
version: 0.7.22
|
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-
|
11
|
+
date: 2016-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|