dapp 0.35.8 → 0.35.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dapp.rb +1 -0
- data/lib/dapp/dapp/ruby2go.rb +4 -0
- data/lib/dapp/dimg/dapp/command/mrproper.rb +16 -64
- data/lib/dapp/dimg/dapp/command/ruby2go_cleanup.rb +21 -0
- data/lib/dapp/dimg/dapp/dapp.rb +2 -0
- data/lib/dapp/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f580bf383e4b07e491cb75f22906262bae4610897e414e3026eadbac2d69147d
|
4
|
+
data.tar.gz: 10779775e0563815a1da1c2cf20748864d38deec3277de137c35536f1acee452
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e21db3e15a5551e9700ec2d6e90cf29c9cd044c4be3b6368580b31309503b9f25cd121662f36b0473ec29e0239543501522045c1c90c719ec613aa70c2770ac7
|
7
|
+
data.tar.gz: 2b9641ed486716218d8240d0711acb3255171d659d0f60f5e77f4718fd13bfd114adb5f4643b08000268417bdf37458b1590f6df0516baeaafbb3f2151c83fa3
|
data/lib/dapp.rb
CHANGED
@@ -251,6 +251,7 @@ require 'dapp/dimg/dapp/command/push'
|
|
251
251
|
require 'dapp/dimg/dapp/command/run'
|
252
252
|
require 'dapp/dimg/dapp/command/spush'
|
253
253
|
require 'dapp/dimg/dapp/command/tag'
|
254
|
+
require 'dapp/dimg/dapp/command/ruby2go_cleanup'
|
254
255
|
require 'dapp/dimg/dapp/command/stages/common'
|
255
256
|
require 'dapp/dimg/dapp/command/stages/cleanup_local'
|
256
257
|
require 'dapp/dimg/dapp/command/stages/cleanup_repo'
|
data/lib/dapp/dapp/ruby2go.rb
CHANGED
@@ -25,6 +25,10 @@ module Dapp
|
|
25
25
|
_ruby2go("git-repo", args_hash)
|
26
26
|
end
|
27
27
|
|
28
|
+
def ruby2go_cleanup(args_hash)
|
29
|
+
_ruby2go("cleanup", args_hash)
|
30
|
+
end
|
31
|
+
|
28
32
|
def ruby2go_init
|
29
33
|
@_call_after_before_terminate << proc {
|
30
34
|
FileUtils.rmtree(@_ruby2go_tmp_dir) if @_ruby2go_tmp_dir
|
@@ -3,73 +3,25 @@ module Dapp
|
|
3
3
|
module Dapp
|
4
4
|
module Command
|
5
5
|
module Mrproper
|
6
|
-
# rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
7
6
|
def mrproper
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
proper_cache_version
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
7
|
+
ruby2go_cleanup_command(:reset, ruby2go_cleanup_reset_options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def ruby2go_cleanup_reset_options
|
11
|
+
{
|
12
|
+
mode: {
|
13
|
+
all: !!options[:proper_all],
|
14
|
+
dev_mode_cache: !!options[:proper_dev_mode_cache],
|
15
|
+
cache_version: proper_cache_version?
|
16
|
+
},
|
17
|
+
cache_version: ::Dapp::BUILD_CACHE_VERSION.to_s,
|
18
|
+
common_options: {
|
19
|
+
dry_run: dry_run?
|
20
|
+
},
|
21
|
+
}.tap do |json|
|
22
|
+
break JSON.dump(json)
|
21
23
|
end
|
22
24
|
end
|
23
|
-
# rubocop:enable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
24
|
-
|
25
|
-
protected
|
26
|
-
|
27
|
-
def mrproper_command_without_any_option?
|
28
|
-
!(proper_all? || proper_dev_mode_cache? || proper_cache_version?)
|
29
|
-
end
|
30
|
-
|
31
|
-
def proper_all?
|
32
|
-
!!options[:proper_all]
|
33
|
-
end
|
34
|
-
|
35
|
-
def proper_dev_mode_cache?
|
36
|
-
!!options[:proper_dev_mode_cache]
|
37
|
-
end
|
38
|
-
|
39
|
-
def proper_all
|
40
|
-
flush_by_label('dapp')
|
41
|
-
end
|
42
|
-
|
43
|
-
def proper_dev_mode_cache
|
44
|
-
flush_by_label('dapp-dev-mode')
|
45
|
-
end
|
46
|
-
|
47
|
-
def flush_by_label(label)
|
48
|
-
dapp_containers_flush_by_label(label)
|
49
|
-
dapp_images_flush_by_label(label)
|
50
|
-
end
|
51
|
-
|
52
|
-
def dapp_images_flush_by_label(label)
|
53
|
-
log_step_with_indent('proper images') do
|
54
|
-
remove_images(dapp_images_names_by_label(label), force: true)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def proper_cache_version
|
59
|
-
log_proper_cache do
|
60
|
-
proper_cache_all_images_names.tap do |proper_cache_images|
|
61
|
-
remove_images(dapp_images_names_by_label('dapp').select { |image_name| !proper_cache_images.include?(image_name) }, force: true)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def proper_cache_all_images_names
|
67
|
-
ruby2go_image_images([{ label: "dapp" }, { label: "dapp-cache-version=#{::Dapp::BUILD_CACHE_VERSION}" }], ignore_tagless: true).map { |i| i["RepoTags"].empty? ? i["Id"] : i["RepoTags"] }.flatten
|
68
|
-
end
|
69
|
-
|
70
|
-
def dapp_images_names_by_label(label)
|
71
|
-
ruby2go_image_images([{ label: "dapp" }, { label: label }], ignore_tagless: true).map { |i| i["RepoTags"].empty? ? i["Id"] : i["RepoTags"] }.flatten
|
72
|
-
end
|
73
25
|
end
|
74
26
|
end
|
75
27
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Dapp
|
2
|
+
module Dimg
|
3
|
+
module Dapp
|
4
|
+
module Command
|
5
|
+
module Ruby2GoCleanup
|
6
|
+
def ruby2go_cleanup_command(command, command_options)
|
7
|
+
options = {
|
8
|
+
command: command,
|
9
|
+
command_options: command_options,
|
10
|
+
options: { host_docker_config_dir: self.class.host_docker_config_dir }
|
11
|
+
}
|
12
|
+
|
13
|
+
ruby2go_cleanup(options).tap do |res|
|
14
|
+
raise Error::Build, code: :ruby2go_cleanup_command_failed_unexpected_error, data: { command: command, message: res["error"] } unless res["error"].nil?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end # Dimg
|
21
|
+
end # Dapp
|
data/lib/dapp/dimg/dapp/dapp.rb
CHANGED
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.35.
|
4
|
+
version: 0.35.9
|
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-10-
|
11
|
+
date: 2018-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -606,6 +606,7 @@ files:
|
|
606
606
|
- lib/dapp/dimg/dapp/command/list.rb
|
607
607
|
- lib/dapp/dimg/dapp/command/mrproper.rb
|
608
608
|
- lib/dapp/dimg/dapp/command/push.rb
|
609
|
+
- lib/dapp/dimg/dapp/command/ruby2go_cleanup.rb
|
609
610
|
- lib/dapp/dimg/dapp/command/run.rb
|
610
611
|
- lib/dapp/dimg/dapp/command/spush.rb
|
611
612
|
- lib/dapp/dimg/dapp/command/stage_image.rb
|