eac_tools 0.63.0 → 0.65.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +32 -32
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +2 -2
- data/sub/avm/lib/avm/data/package.rb +1 -1
- data/sub/avm/lib/avm/data/unit.rb +25 -54
- data/sub/avm/lib/avm/data/unit_with_commands.rb +52 -0
- data/sub/avm/lib/avm/instances/base/subcommand_parent.rb +25 -0
- data/sub/avm/lib/avm/instances/data/files_unit.rb +1 -4
- data/sub/avm/lib/avm/instances/data/unit.rb +14 -2
- data/sub/avm/lib/avm/instances/entry_keys.rb +1 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +2 -2
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +5 -8
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +0 -4
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +5 -0
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +2 -10
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +3 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-tools/avm-tools.gemspec +11 -11
- data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/dump.rb +11 -6
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/load.rb +58 -0
- data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit/clear.rb +4 -3
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/dump.rb +41 -0
- data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit/load.rb +10 -4
- data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data/unit.rb +6 -5
- data/sub/{avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners → avm-tools/lib/avm/tools/runner/instance}/data.rb +4 -3
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_cli/eac_cli.gemspec +1 -1
- data/sub/eac_cli/lib/eac_cli/definition/base_option.rb +3 -1
- data/sub/eac_cli/lib/eac_cli/definition/default_value.rb +17 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +8 -26
- data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +40 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +12 -0
- data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +1 -4
- data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +21 -0
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +0 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/{abstract_methods.rb → acts_as_abstract.rb} +30 -9
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +2 -2
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +3 -3
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_abstract.rb +14 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +5 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +2 -2
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{abstract_methods_spec.rb → acts_as_abstract_spec.rb} +2 -2
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/acts_as_abstract_spec.rb +14 -0
- metadata +34 -29
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +0 -26
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/unit/dump.rb +0 -25
- data/sub/eac_cli/lib/eac_cli/runner_with/help/list_section.rb +0 -22
- data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/list_section_spec.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47a797b3de79a663eae4d7dc4c3cdc600756b13f53386dbcd88fb4732b195eeb
|
4
|
+
data.tar.gz: 263a4b784e9cb99e1a9c023efdd2f048d4b83dfb73247300f6fe92db97c76dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad1076587dc04620251e5a391e0c169467aaaae2db7c725589322abad1f84c2c14e53056f07db414549e80864b3775e18105d1c3a25a7e2db2fb6c3adcaa97c8
|
7
|
+
data.tar.gz: f38150d6c56ceb13ff86d8c921fa6867a3cb65e4f36050f2fcf790558832f0b4d1641f7fefdc125a276b1cab512538668b8d30396ff5c0bf50cfc5cb0c43c3bc
|
data/Gemfile.lock
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.
|
5
|
-
avm (~> 0.
|
4
|
+
eac_tools (0.65.0)
|
5
|
+
avm (~> 0.71)
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.19)
|
7
7
|
avm-eac_generic_base0 (~> 0.12)
|
8
8
|
avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
|
9
9
|
avm-eac_php_base0 (~> 0.4, >= 0.4.2)
|
10
|
-
avm-eac_postgresql_base0 (~> 0.
|
10
|
+
avm-eac_postgresql_base0 (~> 0.5, >= 0.5.1)
|
11
11
|
avm-eac_python_base0 (~> 0.2, >= 0.2.1)
|
12
12
|
avm-eac_rails_base0 (~> 0.10, >= 0.10.2)
|
13
13
|
avm-eac_rails_base1 (~> 0.8, >= 0.8.4)
|
14
14
|
avm-eac_redmine_base0 (~> 0.20, >= 0.20.1)
|
15
15
|
avm-eac_redmine_plugin_base0 (~> 0.4)
|
16
16
|
avm-eac_ruby_base1 (~> 0.30, >= 0.30.2)
|
17
|
-
avm-eac_webapp_base0 (~> 0.
|
17
|
+
avm-eac_webapp_base0 (~> 0.17)
|
18
18
|
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
|
19
19
|
avm-git (~> 0.13, >= 0.13.2)
|
20
|
-
avm-tools (~> 0.
|
21
|
-
eac_ruby_utils (~> 0.
|
20
|
+
avm-tools (~> 0.147)
|
21
|
+
eac_ruby_utils (~> 0.115)
|
22
22
|
|
23
23
|
PATH
|
24
24
|
remote: sub/aranha-parsers
|
@@ -67,9 +67,9 @@ PATH
|
|
67
67
|
PATH
|
68
68
|
remote: sub/avm-eac_postgresql_base0
|
69
69
|
specs:
|
70
|
-
avm-eac_postgresql_base0 (0.
|
71
|
-
avm (~> 0.
|
72
|
-
eac_ruby_utils (~> 0.
|
70
|
+
avm-eac_postgresql_base0 (0.5.1)
|
71
|
+
avm (~> 0.71)
|
72
|
+
eac_ruby_utils (~> 0.115)
|
73
73
|
|
74
74
|
PATH
|
75
75
|
remote: sub/avm-eac_python_base0
|
@@ -134,13 +134,13 @@ PATH
|
|
134
134
|
PATH
|
135
135
|
remote: sub/avm-eac_webapp_base0
|
136
136
|
specs:
|
137
|
-
avm-eac_webapp_base0 (0.
|
138
|
-
avm (~> 0.
|
137
|
+
avm-eac_webapp_base0 (0.17.0)
|
138
|
+
avm (~> 0.70)
|
139
139
|
avm-eac_generic_base0 (~> 0.12)
|
140
|
-
avm-eac_postgresql_base0 (~> 0.
|
140
|
+
avm-eac_postgresql_base0 (~> 0.5)
|
141
141
|
avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.2)
|
142
142
|
avm-files (~> 0.6, >= 0.6.2)
|
143
|
-
eac_ruby_utils (~> 0.
|
143
|
+
eac_ruby_utils (~> 0.114)
|
144
144
|
|
145
145
|
PATH
|
146
146
|
remote: sub/avm-eac_wordpress_base0
|
@@ -173,32 +173,32 @@ PATH
|
|
173
173
|
PATH
|
174
174
|
remote: sub/avm-tools
|
175
175
|
specs:
|
176
|
-
avm-tools (0.
|
177
|
-
aranha-parsers (~> 0.
|
178
|
-
avm (~> 0.
|
179
|
-
avm-eac_ruby_base1 (~> 0.
|
180
|
-
avm-eac_ubuntu_base0 (~> 0.4)
|
181
|
-
avm-files (~> 0.6)
|
182
|
-
avm-git (~> 0.
|
176
|
+
avm-tools (0.147.0)
|
177
|
+
aranha-parsers (~> 0.17, >= 0.17.1)
|
178
|
+
avm (~> 0.71)
|
179
|
+
avm-eac_ruby_base1 (~> 0.30, >= 0.30.2)
|
180
|
+
avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.2)
|
181
|
+
avm-files (~> 0.6, >= 0.6.2)
|
182
|
+
avm-git (~> 0.13, >= 0.13.2)
|
183
183
|
clipboard (~> 1.3, >= 1.3.6)
|
184
184
|
curb (~> 0.9, >= 0.9.11)
|
185
|
-
eac_git (~> 0.14)
|
186
|
-
eac_ruby_base0 (~> 0.
|
187
|
-
eac_templates (~> 0.
|
188
|
-
git (~> 1.
|
189
|
-
ruby-progressbar (~> 1.
|
185
|
+
eac_git (~> 0.14, >= 0.14.1)
|
186
|
+
eac_ruby_base0 (~> 0.18)
|
187
|
+
eac_templates (~> 0.5)
|
188
|
+
git (~> 1.18)
|
189
|
+
ruby-progressbar (~> 1.13)
|
190
190
|
|
191
191
|
PATH
|
192
192
|
remote: sub/avm
|
193
193
|
specs:
|
194
|
-
avm (0.
|
194
|
+
avm (0.71.0)
|
195
195
|
aranha-parsers (~> 0.17, >= 0.17.1)
|
196
|
-
eac_cli (~> 0.
|
196
|
+
eac_cli (~> 0.33)
|
197
197
|
eac_config (~> 0.12)
|
198
198
|
eac_docker (~> 0.7)
|
199
199
|
eac_fs (~> 0.16)
|
200
200
|
eac_git (~> 0.14, >= 0.14.1)
|
201
|
-
eac_ruby_utils (~> 0.
|
201
|
+
eac_ruby_utils (~> 0.115)
|
202
202
|
eac_templates (~> 0.5)
|
203
203
|
filesize (~> 0.2)
|
204
204
|
htmlbeautifier (~> 1.4, >= 1.4.2)
|
@@ -207,10 +207,10 @@ PATH
|
|
207
207
|
PATH
|
208
208
|
remote: sub/eac_cli
|
209
209
|
specs:
|
210
|
-
eac_cli (0.
|
210
|
+
eac_cli (0.33.0)
|
211
211
|
colorize (~> 0.8, >= 0.8.1)
|
212
212
|
eac_config (~> 0.12)
|
213
|
-
eac_ruby_utils (~> 0.
|
213
|
+
eac_ruby_utils (~> 0.114)
|
214
214
|
|
215
215
|
PATH
|
216
216
|
remote: sub/eac_config
|
@@ -261,7 +261,7 @@ PATH
|
|
261
261
|
PATH
|
262
262
|
remote: sub/eac_ruby_utils
|
263
263
|
specs:
|
264
|
-
eac_ruby_utils (0.
|
264
|
+
eac_ruby_utils (0.115.0)
|
265
265
|
activesupport (>= 4, < 7)
|
266
266
|
addressable (~> 2.8, >= 2.8.4)
|
267
267
|
bundler
|
@@ -335,7 +335,7 @@ GEM
|
|
335
335
|
minitest (5.18.0)
|
336
336
|
multipart-post (2.3.0)
|
337
337
|
net-ssh (4.2.0)
|
338
|
-
nokogiri (1.14.
|
338
|
+
nokogiri (1.14.4-x86_64-linux)
|
339
339
|
racc (~> 1.4)
|
340
340
|
ofx-parser (1.1.0)
|
341
341
|
hpricot (>= 0.6)
|
data/lib/eac_tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
15
|
s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
|
16
|
-
s.add_dependency 'eac_cli', '~> 0.
|
16
|
+
s.add_dependency 'eac_cli', '~> 0.33'
|
17
17
|
s.add_dependency 'eac_config', '~> 0.12'
|
18
18
|
s.add_dependency 'eac_docker', '~> 0.7'
|
19
19
|
s.add_dependency 'eac_fs', '~> 0.16'
|
20
20
|
s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
|
21
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
21
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.115'
|
22
22
|
s.add_dependency 'eac_templates', '~> 0.5'
|
23
23
|
s.add_dependency 'filesize', '~> 0.2'
|
24
24
|
s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
|
@@ -6,72 +6,43 @@ require 'eac_ruby_utils/core_ext'
|
|
6
6
|
module Avm
|
7
7
|
module Data
|
8
8
|
class Unit
|
9
|
-
|
10
|
-
|
9
|
+
acts_as_abstract(
|
10
|
+
do_clear: [],
|
11
|
+
do_dump: [:dump_path],
|
12
|
+
do_load: [:dump_path],
|
13
|
+
dump_path_extension: []
|
14
|
+
)
|
11
15
|
enable_speaker
|
16
|
+
include ::Avm::Data::Callbacks
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
# @return [EacRubyUtils::Envs::Command]
|
18
|
-
def #{method_name}
|
19
|
-
fail "\\"#{method_name}\\" is a abstract method. Override in #{singleton_class}."
|
20
|
-
end
|
21
|
-
CODE
|
22
|
-
end
|
23
|
-
|
24
|
-
def extension
|
25
|
-
singleton_class.const_get('EXTENSION')
|
26
|
-
rescue NameError
|
27
|
-
''
|
28
|
-
end
|
29
|
-
|
30
|
-
def name
|
31
|
-
self.class
|
32
|
-
end
|
33
|
-
|
34
|
-
def load_from_directory(directory, identifier)
|
35
|
-
load(unit_on_directory_path(directory, identifier))
|
36
|
-
end
|
37
|
-
|
38
|
-
def dump_to_directory(directory, identifier)
|
39
|
-
dump(unit_on_directory_path(directory, identifier))
|
18
|
+
# @param dump_path [Pathname]
|
19
|
+
# @return [void]
|
20
|
+
def clear
|
21
|
+
run_callbacks(:dump) { do_clear }
|
40
22
|
end
|
41
23
|
|
42
|
-
|
24
|
+
# @param dump_path [Pathname]
|
25
|
+
# @return [void]
|
26
|
+
def dump(dump_path)
|
43
27
|
run_callbacks :dump do
|
44
|
-
infom "Dumping unit \"#{name}\" to \"#{
|
45
|
-
do_dump(
|
28
|
+
infom "Dumping unit \"#{name}\" to \"#{dump_path}\"..."
|
29
|
+
do_dump(dump_path)
|
46
30
|
end
|
47
31
|
end
|
48
32
|
|
49
|
-
# @
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
def load(data_path)
|
33
|
+
# @param dump_path [Pathname]
|
34
|
+
# @return [void]
|
35
|
+
def load(dump_path)
|
55
36
|
run_callbacks :load do
|
56
|
-
|
57
|
-
|
37
|
+
clear
|
38
|
+
infom "Loading unit \"#{name}\" from \"#{dump_path}\"..."
|
39
|
+
do_load(dump_path)
|
58
40
|
end
|
59
41
|
end
|
60
42
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
dump_command.execute!(output_file: data_path)
|
65
|
-
end
|
66
|
-
|
67
|
-
def do_load(data_path)
|
68
|
-
load_command.execute!(input_file: data_path)
|
69
|
-
end
|
70
|
-
|
71
|
-
private
|
72
|
-
|
73
|
-
def unit_on_directory_path(directory, identifier)
|
74
|
-
::File.join(directory, "#{identifier}#{extension}")
|
43
|
+
# @return [String]
|
44
|
+
def name
|
45
|
+
self.class.name
|
75
46
|
end
|
76
47
|
end
|
77
48
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/data/callbacks'
|
4
|
+
require 'avm/data/unit'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Data
|
9
|
+
class UnitWithCommands < ::Avm::Data::Unit
|
10
|
+
acts_as_abstract
|
11
|
+
|
12
|
+
abstract_method :dump_command
|
13
|
+
abstract_method :load_command
|
14
|
+
|
15
|
+
# @return [String]
|
16
|
+
def dump_path_extension
|
17
|
+
singleton_class.const_get('EXTENSION')
|
18
|
+
rescue NameError
|
19
|
+
''
|
20
|
+
end
|
21
|
+
|
22
|
+
def load_from_directory(directory, identifier)
|
23
|
+
load(unit_on_directory_path(directory, identifier))
|
24
|
+
end
|
25
|
+
|
26
|
+
def dump_to_directory(directory, identifier)
|
27
|
+
dump(unit_on_directory_path(directory, identifier))
|
28
|
+
end
|
29
|
+
|
30
|
+
# @return [Struct(:key, :subpath), nil]
|
31
|
+
def installation_files_data
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
|
35
|
+
protected
|
36
|
+
|
37
|
+
def do_dump(data_path)
|
38
|
+
dump_command.execute!(output_file: data_path)
|
39
|
+
end
|
40
|
+
|
41
|
+
def do_load(data_path)
|
42
|
+
load_command.execute!(input_file: data_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def unit_on_directory_path(directory, identifier)
|
48
|
+
::File.join(directory, "#{identifier}#{dump_path_extension}")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner/context'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Instances
|
8
|
+
class Base
|
9
|
+
class SubcommandParent
|
10
|
+
enable_simple_cache
|
11
|
+
common_constructor :instance
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def runner_context_uncached
|
16
|
+
::EacCli::Runner::Context.new(self, argv: runner_argv)
|
17
|
+
end
|
18
|
+
|
19
|
+
def runner_argv
|
20
|
+
[instance.class.name.split('::')[-2].dasherize, instance.id]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -17,8 +17,6 @@ module Avm
|
|
17
17
|
self.options = self.class.lists.option.hash_keys_validate!(options)
|
18
18
|
end
|
19
19
|
|
20
|
-
before_load :clear
|
21
|
-
|
22
20
|
# @return [Pathname]
|
23
21
|
def files_path
|
24
22
|
fs_path_subpath
|
@@ -33,8 +31,7 @@ module Avm
|
|
33
31
|
instance_command('tar', '-xzf', '-', '-C', files_path)
|
34
32
|
end
|
35
33
|
|
36
|
-
def
|
37
|
-
infom "Removing all files under #{files_path}..."
|
34
|
+
def do_clear
|
38
35
|
instance_command('mkdir', '-p', files_path).execute!
|
39
36
|
instance_command('find', files_path, '-mindepth', 1, '-delete').execute!
|
40
37
|
end
|
@@ -1,13 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/data/
|
3
|
+
require 'avm/data/unit_with_commands'
|
4
4
|
require 'eac_ruby_utils/core_ext'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Instances
|
8
8
|
module Data
|
9
|
-
class Unit < ::Avm::Data::
|
9
|
+
class Unit < ::Avm::Data::UnitWithCommands
|
10
10
|
common_constructor :instance
|
11
|
+
|
12
|
+
# @return [Pathname]
|
13
|
+
def data_default_dump_path
|
14
|
+
instance.data_default_dump_path.to_pathname.basename_sub('.*') do |b|
|
15
|
+
"#{b}_#{identifier}#{dump_path_extension}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
def identifier
|
21
|
+
instance.data_package.units.key(self) || raise("No identifier found for #{self}")
|
22
|
+
end
|
11
23
|
end
|
12
24
|
end
|
13
25
|
end
|
@@ -28,6 +28,7 @@ module Avm
|
|
28
28
|
{
|
29
29
|
'' => %w[name source_instance_id],
|
30
30
|
admin: URI_FIELDS + %w[api_key],
|
31
|
+
data: %w[default_dump_path],
|
31
32
|
database: URI_FIELDS + %w[id limit name system timeout extra],
|
32
33
|
docker: %w[registry],
|
33
34
|
install: URI_FIELDS + %w[id data_path email groupname],
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.71'
|
16
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.115'
|
17
17
|
|
18
18
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
19
19
|
end
|
@@ -12,10 +12,7 @@ module Avm
|
|
12
12
|
TABLES_SQL = "select schemaname || '#{TABLE_PARTS_SEPARATOR}' || tablename from " \
|
13
13
|
"pg_tables where schemaname = '#{SCHEMA_VAR}'"
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
def clear
|
18
|
-
info 'Clearing database (Dropping all tables)...'
|
15
|
+
def do_clear
|
19
16
|
ts = tables
|
20
17
|
if ts.empty?
|
21
18
|
info 'Database has no tables'
|
@@ -26,11 +23,11 @@ module Avm
|
|
26
23
|
end
|
27
24
|
|
28
25
|
def dump_command
|
29
|
-
instance.dump_gzip_command
|
26
|
+
instance.pg.dump_gzip_command
|
30
27
|
end
|
31
28
|
|
32
29
|
def load_command
|
33
|
-
instance.load_gzip_command
|
30
|
+
instance.pg.load_gzip_command
|
34
31
|
end
|
35
32
|
|
36
33
|
private
|
@@ -49,7 +46,7 @@ module Avm
|
|
49
46
|
end
|
50
47
|
|
51
48
|
def run_sql(sql)
|
52
|
-
instance.psql_command_command(sql).execute!
|
49
|
+
instance.pg.psql_command_command(sql).execute!
|
53
50
|
end
|
54
51
|
|
55
52
|
# @return [Array<String>]
|
@@ -60,7 +57,7 @@ module Avm
|
|
60
57
|
|
61
58
|
# @return [String]
|
62
59
|
def tables_sql
|
63
|
-
TABLES_SQL.gsub(SCHEMA_VAR, instance.schema)
|
60
|
+
TABLES_SQL.gsub(SCHEMA_VAR, instance.pg.schema)
|
64
61
|
end
|
65
62
|
end
|
66
63
|
end
|
@@ -12,12 +12,12 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.70'
|
16
16
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.12'
|
17
|
-
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.
|
17
|
+
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.5'
|
18
18
|
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4', '>= 0.4.2'
|
19
19
|
s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
|
20
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
20
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.114'
|
21
21
|
|
22
22
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
23
23
|
end
|
@@ -15,18 +15,10 @@ module Avm
|
|
15
15
|
include ::Avm::EacPostgresqlBase0::InstanceWith
|
16
16
|
enable_simple_cache
|
17
17
|
|
18
|
-
def data_dump(argv = [])
|
19
|
-
run_subcommand(data_dump_runner_class, argv)
|
20
|
-
end
|
21
|
-
|
22
|
-
def data_dump_runner_class
|
23
|
-
::Avm::EacWebappBase0::Instances::Runners::Data::Dump
|
24
|
-
end
|
25
|
-
|
26
18
|
def run_subcommand(subcommand_class, argv)
|
27
19
|
subcommand_class.create(
|
28
20
|
argv: argv,
|
29
|
-
parent: ::Avm::
|
21
|
+
parent: ::Avm::Instances::Base::SubcommandParent.new(self)
|
30
22
|
).run
|
31
23
|
end
|
32
24
|
|
@@ -41,7 +33,7 @@ module Avm
|
|
41
33
|
end
|
42
34
|
|
43
35
|
def database_unit
|
44
|
-
|
36
|
+
pg_data_unit
|
45
37
|
end
|
46
38
|
|
47
39
|
private
|
@@ -33,7 +33,9 @@ module Avm
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def source_instance_dump_path
|
36
|
-
runner_context.call(:instance).class.by_id(parsed.source_instance).
|
36
|
+
runner_context.call(:instance).class.by_id(parsed.source_instance).run_subcommand(
|
37
|
+
::Avm::EacWebappBase0::Instances::Runners::Data::Dump, []
|
38
|
+
)
|
37
39
|
end
|
38
40
|
|
39
41
|
def load_dump
|
@@ -14,19 +14,19 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.bindir = 'exe'
|
15
15
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
16
16
|
|
17
|
-
s.add_dependency 'aranha-parsers', '~> 0.
|
18
|
-
s.add_dependency 'avm', '~> 0.
|
19
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.
|
20
|
-
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4'
|
21
|
-
s.add_dependency 'avm-files', '~> 0.6'
|
22
|
-
s.add_dependency 'avm-git', '~> 0.
|
17
|
+
s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
|
18
|
+
s.add_dependency 'avm', '~> 0.71'
|
19
|
+
s.add_dependency 'avm-eac_ruby_base1', '~> 0.30', '>= 0.30.2'
|
20
|
+
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4', '>= 0.4.2'
|
21
|
+
s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
|
22
|
+
s.add_dependency 'avm-git', '~> 0.13', '>= 0.13.2'
|
23
23
|
s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
|
24
24
|
s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
|
25
|
-
s.add_dependency 'eac_git', '~> 0.14'
|
26
|
-
s.add_dependency 'eac_ruby_base0', '~> 0.
|
27
|
-
s.add_dependency 'eac_templates', '~> 0.
|
28
|
-
s.add_dependency 'git', '~> 1.
|
29
|
-
s.add_dependency 'ruby-progressbar', '~> 1.
|
25
|
+
s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
|
26
|
+
s.add_dependency 'eac_ruby_base0', '~> 0.18'
|
27
|
+
s.add_dependency 'eac_templates', '~> 0.5'
|
28
|
+
s.add_dependency 'git', '~> 1.18'
|
29
|
+
s.add_dependency 'ruby-progressbar', '~> 1.13'
|
30
30
|
|
31
31
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
32
32
|
end
|
@@ -1,23 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/data/package/dump'
|
4
|
+
require 'avm/instances/runner'
|
4
5
|
require 'eac_cli/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
7
|
-
module
|
8
|
-
|
9
|
-
|
8
|
+
module Tools
|
9
|
+
class Runner
|
10
|
+
class Instance < ::Avm::Instances::Runner
|
10
11
|
class Data
|
11
12
|
class Dump
|
12
13
|
DUMP_EXPIRE_TIME = 1.day
|
13
|
-
DEFAULT_DUMP_PATH_ENTRY_SUFFIX = 'data.default_dump_path'
|
14
14
|
NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
|
15
15
|
'dump was expired.'
|
16
16
|
|
17
17
|
runner_with :help do
|
18
18
|
desc 'Dump utility for EacRailsBase instance.'
|
19
19
|
bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
|
20
|
-
|
20
|
+
pos_arg :dump_path
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String]
|
24
|
+
def help_extra_text
|
25
|
+
"Default dump path: \"#{default_dump_path}\""
|
21
26
|
end
|
22
27
|
|
23
28
|
def run
|
@@ -47,7 +52,7 @@ module Avm
|
|
47
52
|
end
|
48
53
|
|
49
54
|
def default_dump_path
|
50
|
-
instance.
|
55
|
+
instance.data_default_dump_path
|
51
56
|
end
|
52
57
|
|
53
58
|
def package_dump_existing
|