avm-tools 0.145.0 → 0.146.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/tools/runner/instance/data/dump.rb +70 -0
- data/lib/avm/tools/runner/instance/data/load.rb +58 -0
- data/lib/avm/tools/runner/instance/data/unit/clear.rb +24 -0
- data/lib/avm/tools/runner/instance/data/unit/dump.rb +41 -0
- data/lib/avm/tools/runner/instance/data/unit.rb +42 -0
- data/lib/avm/tools/runner/instance/data.rb +20 -0
- data/lib/avm/tools/version.rb +1 -1
- metadata +56 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d991bbca749dc14183de47e3f7880ea924c4cd3357428d02e5740ec1aa17ce0
|
4
|
+
data.tar.gz: 94bee26f8abc3a62d2482b5091fd3a0a95708004c5f9585aa33ae183a054caaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26616f9be672e8a3da83b55a481c8064a4a9e0e0c1e4486825388d089d634763cd1bc6cf09a026aaecff2de1eb5890093d8685bf1bc12475005cc215b2fdf073
|
7
|
+
data.tar.gz: 30e7a998895ba25b11255d9bf1e9b8e67e40f039ce75274d2a625f33011f6a4c43f8b230eedf3a9295e095f4496091b9a03c4fd1089547df8b9065e921746733
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/data/package/dump'
|
4
|
+
require 'avm/instances/runner'
|
5
|
+
require 'eac_cli/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Tools
|
9
|
+
class Runner
|
10
|
+
class Instance < ::Avm::Instances::Runner
|
11
|
+
class Data
|
12
|
+
class Dump
|
13
|
+
DUMP_EXPIRE_TIME = 1.day
|
14
|
+
NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
|
15
|
+
'dump was expired.'
|
16
|
+
|
17
|
+
runner_with :help do
|
18
|
+
desc 'Dump utility for EacRailsBase instance.'
|
19
|
+
bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
|
20
|
+
pos_arg :dump_path
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [String]
|
24
|
+
def help_extra_text
|
25
|
+
"Default dump path: \"#{default_dump_path}\""
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
infov 'Instance to dump', "#{instance} (#{instance.class})"
|
30
|
+
if package_dump.runnable?
|
31
|
+
package_dump.run
|
32
|
+
else
|
33
|
+
warn(package_dump.cannot_run_reason)
|
34
|
+
end
|
35
|
+
success("Dump path: \"#{dump_path}\"")
|
36
|
+
dump_path
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def instance
|
42
|
+
runner_context.call(:instance)
|
43
|
+
end
|
44
|
+
|
45
|
+
def package_dump_uncached
|
46
|
+
instance
|
47
|
+
.data_package.dump(dump_path, existing: package_dump_existing)
|
48
|
+
end
|
49
|
+
|
50
|
+
def dump_path
|
51
|
+
parsed.dump_path || default_dump_path
|
52
|
+
end
|
53
|
+
|
54
|
+
def default_dump_path
|
55
|
+
instance.data_default_dump_path
|
56
|
+
end
|
57
|
+
|
58
|
+
def package_dump_existing
|
59
|
+
if parsed.rewrite?
|
60
|
+
::Avm::Data::Package::Dump::EXISTING_ROTATE
|
61
|
+
else
|
62
|
+
::Avm::Data::Package::Dump::EXISTING_ROTATE_EXPIRED
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class Instance < ::Avm::Instances::Runner
|
10
|
+
class Data
|
11
|
+
class Load
|
12
|
+
runner_with :help do
|
13
|
+
desc 'Load utility for EacRailsBase instance.'
|
14
|
+
arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
|
15
|
+
pos_arg :dump_path, optional: true
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
return fatal_error("Dump \"#{dump_path}\" does not exist") unless
|
20
|
+
::File.exist?(dump_path)
|
21
|
+
|
22
|
+
load_dump
|
23
|
+
success("Dump loaded from \"#{dump_path}\"")
|
24
|
+
end
|
25
|
+
|
26
|
+
def dump_path_uncached
|
27
|
+
return parsed.dump_path.to_s if parsed.dump_path.present?
|
28
|
+
return source_instance_dump_path if parsed.source_instance.present?
|
29
|
+
|
30
|
+
raise "Dump path unknown (Options: #{parsed})"
|
31
|
+
end
|
32
|
+
|
33
|
+
def source_instance_dump_path
|
34
|
+
runner_context.call(:instance).class.by_id(parsed.source_instance).run_subcommand(
|
35
|
+
::Avm::Tools::Runner::Instance::Data::Dump, []
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def load_dump
|
40
|
+
info "Loading dump \"#{dump_path}\"..."
|
41
|
+
package_load.run
|
42
|
+
end
|
43
|
+
|
44
|
+
def dump_instance_method
|
45
|
+
:dump_database
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def package_load_uncached
|
51
|
+
runner_context.call(:instance).data_package.load(dump_path)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class Instance < ::Avm::Instances::Runner
|
10
|
+
class Data
|
11
|
+
class Unit
|
12
|
+
class Clear
|
13
|
+
runner_with :help
|
14
|
+
|
15
|
+
def run
|
16
|
+
runner_context.call(:data_unit).clear
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class Instance < ::Avm::Instances::Runner
|
10
|
+
class Data
|
11
|
+
class Unit
|
12
|
+
class Dump
|
13
|
+
runner_with :help do
|
14
|
+
pos_arg :dump_path, optional: true
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
runner_context.call(:data_unit).dump(dump_path)
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [String]
|
22
|
+
def help_extra_text
|
23
|
+
"Default dump path: \"#{default_dump_path}\""
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return [Pathname]
|
27
|
+
def dump_path
|
28
|
+
(parsed.dump_path || default_dump_path).to_pathname
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [String]
|
32
|
+
def default_dump_path
|
33
|
+
runner_context.call(:data_unit).data_default_dump_path
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class Instance < ::Avm::Instances::Runner
|
10
|
+
class Data
|
11
|
+
class Unit
|
12
|
+
require_sub __FILE__
|
13
|
+
runner_with :help, :subcommands do
|
14
|
+
pos_arg :identifier
|
15
|
+
subcommands
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Enumerable<String>]
|
19
|
+
def available_units_ids
|
20
|
+
data_package.units_ids
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Avm::Instances::Data::Package]
|
24
|
+
def data_package
|
25
|
+
runner_context.call(:instance).data_package
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [Avm::Instances::Data::Unit]
|
29
|
+
def data_unit
|
30
|
+
data_package.unit(parsed.identifier)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [String]
|
34
|
+
def help_extra_text
|
35
|
+
help_join_sections(super, list_section('Available units', available_units_ids))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class Instance < ::Avm::Instances::Runner
|
10
|
+
class Data
|
11
|
+
require_sub __FILE__
|
12
|
+
runner_with :help, :subcommands do
|
13
|
+
desc 'Data utilities for EacRailsBase0 instances.'
|
14
|
+
subcommands
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/avm/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.146.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -16,48 +16,54 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.17'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.17.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.17'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.17.1
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: avm
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.70'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.70'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: avm-eac_ruby_base1
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.30'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.30.2
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
61
|
- - "~>"
|
59
62
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
63
|
+
version: '0.30'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.30.2
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: avm-eac_ubuntu_base0
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +71,9 @@ dependencies:
|
|
65
71
|
- - "~>"
|
66
72
|
- !ruby/object:Gem::Version
|
67
73
|
version: '0.4'
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.4.2
|
68
77
|
type: :runtime
|
69
78
|
prerelease: false
|
70
79
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,6 +81,9 @@ dependencies:
|
|
72
81
|
- - "~>"
|
73
82
|
- !ruby/object:Gem::Version
|
74
83
|
version: '0.4'
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.4.2
|
75
87
|
- !ruby/object:Gem::Dependency
|
76
88
|
name: avm-files
|
77
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,6 +91,9 @@ dependencies:
|
|
79
91
|
- - "~>"
|
80
92
|
- !ruby/object:Gem::Version
|
81
93
|
version: '0.6'
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.6.2
|
82
97
|
type: :runtime
|
83
98
|
prerelease: false
|
84
99
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -86,20 +101,29 @@ dependencies:
|
|
86
101
|
- - "~>"
|
87
102
|
- !ruby/object:Gem::Version
|
88
103
|
version: '0.6'
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.6.2
|
89
107
|
- !ruby/object:Gem::Dependency
|
90
108
|
name: avm-git
|
91
109
|
requirement: !ruby/object:Gem::Requirement
|
92
110
|
requirements:
|
93
111
|
- - "~>"
|
94
112
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0.
|
113
|
+
version: '0.13'
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.13.2
|
96
117
|
type: :runtime
|
97
118
|
prerelease: false
|
98
119
|
version_requirements: !ruby/object:Gem::Requirement
|
99
120
|
requirements:
|
100
121
|
- - "~>"
|
101
122
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
123
|
+
version: '0.13'
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 0.13.2
|
103
127
|
- !ruby/object:Gem::Dependency
|
104
128
|
name: clipboard
|
105
129
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +171,9 @@ dependencies:
|
|
147
171
|
- - "~>"
|
148
172
|
- !ruby/object:Gem::Version
|
149
173
|
version: '0.14'
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: 0.14.1
|
150
177
|
type: :runtime
|
151
178
|
prerelease: false
|
152
179
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -154,80 +181,65 @@ dependencies:
|
|
154
181
|
- - "~>"
|
155
182
|
- !ruby/object:Gem::Version
|
156
183
|
version: '0.14'
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 0.14.1
|
157
187
|
- !ruby/object:Gem::Dependency
|
158
188
|
name: eac_ruby_base0
|
159
189
|
requirement: !ruby/object:Gem::Requirement
|
160
190
|
requirements:
|
161
191
|
- - "~>"
|
162
192
|
- !ruby/object:Gem::Version
|
163
|
-
version: '0.
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 0.17.1
|
193
|
+
version: '0.18'
|
167
194
|
type: :runtime
|
168
195
|
prerelease: false
|
169
196
|
version_requirements: !ruby/object:Gem::Requirement
|
170
197
|
requirements:
|
171
198
|
- - "~>"
|
172
199
|
- !ruby/object:Gem::Version
|
173
|
-
version: '0.
|
174
|
-
- - ">="
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: 0.17.1
|
200
|
+
version: '0.18'
|
177
201
|
- !ruby/object:Gem::Dependency
|
178
202
|
name: eac_templates
|
179
203
|
requirement: !ruby/object:Gem::Requirement
|
180
204
|
requirements:
|
181
205
|
- - "~>"
|
182
206
|
- !ruby/object:Gem::Version
|
183
|
-
version: '0.
|
184
|
-
- - ">="
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: 0.3.2
|
207
|
+
version: '0.5'
|
187
208
|
type: :runtime
|
188
209
|
prerelease: false
|
189
210
|
version_requirements: !ruby/object:Gem::Requirement
|
190
211
|
requirements:
|
191
212
|
- - "~>"
|
192
213
|
- !ruby/object:Gem::Version
|
193
|
-
version: '0.
|
194
|
-
- - ">="
|
195
|
-
- !ruby/object:Gem::Version
|
196
|
-
version: 0.3.2
|
214
|
+
version: '0.5'
|
197
215
|
- !ruby/object:Gem::Dependency
|
198
216
|
name: git
|
199
217
|
requirement: !ruby/object:Gem::Requirement
|
200
218
|
requirements:
|
201
219
|
- - "~>"
|
202
220
|
- !ruby/object:Gem::Version
|
203
|
-
version: '1.
|
204
|
-
- - ">="
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
version: 1.13.1
|
221
|
+
version: '1.18'
|
207
222
|
type: :runtime
|
208
223
|
prerelease: false
|
209
224
|
version_requirements: !ruby/object:Gem::Requirement
|
210
225
|
requirements:
|
211
226
|
- - "~>"
|
212
227
|
- !ruby/object:Gem::Version
|
213
|
-
version: '1.
|
214
|
-
- - ">="
|
215
|
-
- !ruby/object:Gem::Version
|
216
|
-
version: 1.13.1
|
228
|
+
version: '1.18'
|
217
229
|
- !ruby/object:Gem::Dependency
|
218
230
|
name: ruby-progressbar
|
219
231
|
requirement: !ruby/object:Gem::Requirement
|
220
232
|
requirements:
|
221
233
|
- - "~>"
|
222
234
|
- !ruby/object:Gem::Version
|
223
|
-
version: '1.
|
235
|
+
version: '1.13'
|
224
236
|
type: :runtime
|
225
237
|
prerelease: false
|
226
238
|
version_requirements: !ruby/object:Gem::Requirement
|
227
239
|
requirements:
|
228
240
|
- - "~>"
|
229
241
|
- !ruby/object:Gem::Version
|
230
|
-
version: '1.
|
242
|
+
version: '1.13'
|
231
243
|
- !ruby/object:Gem::Dependency
|
232
244
|
name: eac_ruby_gem_support
|
233
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,6 +287,12 @@ files:
|
|
275
287
|
- lib/avm/tools/runner/git/subrepo/clone.rb
|
276
288
|
- lib/avm/tools/runner/git/subrepo/fix.rb
|
277
289
|
- lib/avm/tools/runner/instance.rb
|
290
|
+
- lib/avm/tools/runner/instance/data.rb
|
291
|
+
- lib/avm/tools/runner/instance/data/dump.rb
|
292
|
+
- lib/avm/tools/runner/instance/data/load.rb
|
293
|
+
- lib/avm/tools/runner/instance/data/unit.rb
|
294
|
+
- lib/avm/tools/runner/instance/data/unit/clear.rb
|
295
|
+
- lib/avm/tools/runner/instance/data/unit/dump.rb
|
278
296
|
- lib/avm/tools/runner/instance/info.rb
|
279
297
|
- lib/avm/tools/runner/launcher.rb
|
280
298
|
- lib/avm/tools/runner/launcher/instances.rb
|