eac_tools 0.22.0 → 0.23.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 +43 -43
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/instances/base.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +5 -5
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb +13 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances.rb +11 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
- data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/base.rb +2 -2
- data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/base.rb +13 -0
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances.rb +11 -0
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb +1 -1
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +2 -2
- data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +2 -2
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +27 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb +11 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +1 -1
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +2 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +6 -6
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +48 -4
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +4 -4
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +26 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +61 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/dump.rb +65 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +57 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data.rb +19 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb +13 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +2 -2
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
- metadata +31 -43
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb +0 -11
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instance.rb +0 -11
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -25
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instance.rb +0 -57
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +0 -62
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +0 -63
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +0 -55
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +0 -17
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/data/package/dump'
|
4
|
-
require 'eac_cli/core_ext'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacWebappBase0
|
8
|
-
class Runner < ::Avm::Instances::Runner
|
9
|
-
class Data
|
10
|
-
class Dump
|
11
|
-
DUMP_EXPIRE_TIME = 1.day
|
12
|
-
DEFAULT_DUMP_PATH_ENTRY_SUFFIX = 'data.default_dump_path'
|
13
|
-
NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
|
14
|
-
'dump was expired.'
|
15
|
-
|
16
|
-
runner_with :help do
|
17
|
-
desc 'Dump utility for EacRailsBase instance.'
|
18
|
-
bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
|
19
|
-
arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
|
20
|
-
end
|
21
|
-
|
22
|
-
def run
|
23
|
-
infov 'Instance to dump', "#{instance} (#{instance.class})"
|
24
|
-
if package_dump.runnable?
|
25
|
-
package_dump.run
|
26
|
-
else
|
27
|
-
warn(package_dump.cannot_run_reason)
|
28
|
-
end
|
29
|
-
success("Dump path: \"#{dump_path}\"")
|
30
|
-
dump_path
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def instance
|
36
|
-
runner_context.call(:instance)
|
37
|
-
end
|
38
|
-
|
39
|
-
def package_dump_uncached
|
40
|
-
instance
|
41
|
-
.data_package.dump(dump_path, existing: package_dump_existing)
|
42
|
-
end
|
43
|
-
|
44
|
-
def dump_path
|
45
|
-
parsed.dump_path || default_dump_path
|
46
|
-
end
|
47
|
-
|
48
|
-
def default_dump_path
|
49
|
-
instance.read_entry(DEFAULT_DUMP_PATH_ENTRY_SUFFIX)
|
50
|
-
end
|
51
|
-
|
52
|
-
def package_dump_existing
|
53
|
-
if parsed.rewrite?
|
54
|
-
::Avm::Data::Package::Dump::EXISTING_ROTATE
|
55
|
-
else
|
56
|
-
::Avm::Data::Package::Dump::EXISTING_ROTATE_EXPIRED
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'active_support/core_ext/numeric/time'
|
4
|
-
require 'eac_cli/speaker'
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
6
|
-
|
7
|
-
module Avm
|
8
|
-
module EacWebappBase0
|
9
|
-
class Runner < ::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 ::Dev::Result.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).data_dump
|
35
|
-
end
|
36
|
-
|
37
|
-
def load_dump
|
38
|
-
info "Loading dump \"#{dump_path}\"..."
|
39
|
-
package_load.run
|
40
|
-
end
|
41
|
-
|
42
|
-
def dump_instance_method
|
43
|
-
:dump_database
|
44
|
-
end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
def package_load_uncached
|
49
|
-
runner_context.call(:instance).data_package.load(dump_path)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module EacWebappBase0
|
7
|
-
class Runner < ::Avm::Instances::Runner
|
8
|
-
class Data
|
9
|
-
require_sub __FILE__
|
10
|
-
runner_with :help, :subcommands do
|
11
|
-
desc 'Data utilities for EacRailsBase0 instances.'
|
12
|
-
subcommands
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|