avm-tools 0.94.2 → 0.98.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/app_src.rb +60 -0
- data/lib/avm/core_ext.rb +4 -0
- data/lib/avm/docker/runner.rb +22 -30
- data/lib/avm/eac_asciidoctor_base0/deploy.rb +5 -5
- data/lib/avm/eac_rails_base1/runner/bundle.rb +0 -1
- data/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -1
- data/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -1
- data/lib/avm/eac_webapp_base0/instance.rb +5 -2
- data/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +1 -0
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
- data/lib/avm/git/issue/complete/_test.rb +2 -2
- data/lib/avm/instances/base.rb +6 -12
- data/lib/avm/instances/base/entry_keys.rb +17 -0
- data/lib/{eac_launcher → avm/launcher}/instances/error.rb +0 -0
- data/lib/avm/launcher/instances/runner_helper.rb +41 -0
- data/lib/avm/patches/class.rb +4 -0
- data/lib/avm/patches/eac_ruby_gems_utils.rb +4 -0
- data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
- data/lib/avm/patches/object.rb +4 -0
- data/lib/avm/patches/object/fs_cache.rb +16 -0
- data/lib/avm/ruby/bundler.rb +11 -0
- data/lib/avm/ruby/bundler/incompatible_parser.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +25 -0
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +39 -0
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +73 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +31 -0
- data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +19 -0
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +26 -0
- data/lib/avm/ruby/gems/generator.rb +1 -5
- data/lib/avm/ruby/rubocop/_configured.rb +2 -2
- data/lib/avm/tools/runner/{local_project.rb → app_src.rb} +3 -3
- data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +14 -0
- data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0/build.rb +19 -7
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0.rb +1 -2
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_chapters.rb +1 -2
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_single.rb +1 -2
- data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/info.rb +1 -2
- data/lib/avm/tools/runner/app_src/info.rb +22 -0
- data/lib/avm/tools/runner/{local_project → app_src}/ruby.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler.rb +1 -1
- data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler/gemfile_lock.rb +1 -1
- data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +84 -0
- data/lib/avm/tools/runner/{local_project → app_src}/test.rb +6 -9
- data/lib/avm/tools/runner/app_src/update.rb +22 -0
- data/lib/avm/tools/runner/{local_project → app_src}/version_bump.rb +1 -1
- data/lib/avm/tools/runner/eac_asciidoctor_base0.rb +0 -1
- data/lib/avm/tools/runner/eac_rails_base0.rb +0 -1
- data/lib/avm/tools/runner/eac_redmine_base0.rb +0 -1
- data/lib/avm/tools/runner/eac_wordpress_base0.rb +0 -1
- data/lib/avm/tools/runner/eac_writings_base0.rb +0 -1
- data/lib/avm/tools/runner/git.rb +0 -1
- data/lib/avm/tools/runner/git/commit.rb +0 -1
- data/lib/avm/tools/runner/git/dirty_files.rb +17 -22
- data/lib/avm/tools/runner/git/issue.rb +21 -36
- data/lib/avm/tools/runner/git/organize.rb +6 -9
- data/lib/avm/tools/runner/git/revisions_test.rb +14 -25
- data/lib/avm/tools/runner/git/subrepo.rb +3 -6
- data/lib/avm/tools/runner/git/subrepo/check.rb +10 -13
- data/lib/avm/tools/runner/git/subrepo/clone.rb +2 -3
- data/lib/avm/tools/runner/git/subrepo/fix.rb +2 -3
- data/lib/avm/tools/runner/launcher.rb +3 -6
- data/lib/avm/tools/runner/launcher/instances.rb +10 -21
- data/lib/avm/tools/runner/launcher/projects.rb +10 -18
- data/lib/avm/tools/runner/launcher/publish.rb +18 -26
- data/lib/avm/tools/runner/ruby/rubocop.rb +9 -25
- data/lib/avm/tools/runner/self.rb +7 -15
- data/lib/avm/tools/runner/self/docker.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/lib/eac_launcher/instances.rb +1 -1
- data/template/avm/ruby/gems/generator/static/spec/rubocop_spec.rb +1 -5
- data/template/avm/ruby/gems/generator/static/spec/spec_helper.rb +2 -0
- data/vendor/avm-apps/avm-apps.gemspec +1 -1
- data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +57 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +18 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +26 -0
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +29 -0
- data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
- data/vendor/avm-apps/spec/rubocop_spec.rb +1 -5
- data/vendor/avm-apps/spec/spec_helper.rb +3 -0
- data/vendor/avm-eac_asciidoctor_base0/Gemfile +5 -0
- data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +20 -0
- data/{lib/avm/local_projects.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb} +1 -1
- data/{lib/avm/eac_asciidoctor_base0/project.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb} +2 -4
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +19 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +49 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +30 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +30 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +54 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +7 -0
- data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +3 -0
- data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +102 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +3 -1
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +8 -1
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_cli/spec/spec_helper.rb +3 -0
- data/vendor/eac_docker/eac_docker.gemspec +1 -1
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_docker/spec/spec_helper.rb +3 -0
- data/vendor/eac_git/eac_git.gemspec +2 -1
- data/vendor/eac_git/lib/eac_git/local.rb +4 -0
- data/vendor/eac_git/lib/eac_git/local/commit.rb +53 -0
- data/vendor/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
- data/vendor/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
- data/vendor/eac_git/lib/eac_git/rspec.rb +6 -1
- data/{lib/avm/git/spec_helper.rb → vendor/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb} +16 -13
- data/vendor/eac_git/lib/eac_git/version.rb +1 -1
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
- data/vendor/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
- data/vendor/eac_git/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_git/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +4 -3
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +9 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
- metadata +120 -39
- data/lib/avm/eac_asciidoctor_base0/build.rb +0 -47
- data/lib/avm/eac_asciidoctor_base0/build/file.rb +0 -28
- data/lib/avm/instances/configuration.rb +0 -55
- data/lib/avm/instances/configuration/_locale.rb +0 -16
- data/lib/avm/instances/configuration/_rubocop.rb +0 -24
- data/lib/avm/instances/configuration/_tests.rb +0 -27
- data/lib/avm/local_projects/instance.rb +0 -62
- data/lib/avm/tools/runner/local_project/eac_asciidoctor_base0.rb +0 -32
- data/lib/avm/tools/runner/local_project/info.rb +0 -25
- data/lib/avm/tools/runner/local_project/update.rb +0 -25
- data/lib/eac_launcher/instances/runner_helper.rb +0 -42
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a8cd450cfc4285226ff31b7a2183ae8cb87c3cb3b688548251bd5b92c25f9c3
|
4
|
+
data.tar.gz: 4865bc83bfa9a0f04c76fce01c546d3c8df123f63647d4fdbcd6ebfc9389aaed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bfbd03718cedd613906c9c550db8d1ac5ff05a4e904bce261d13382bbb20f10d7e5ab72de57f396499f5616356a7419b2fca3a65ed7fa7a3d8f7d6e0ff48841
|
7
|
+
data.tar.gz: 97fbf67954eca6d3e64d8165c6c523a092a3b50442d506858ea412a7c1849285b7d90364679773a91927b6298d1b01fad73bbcb5edadb73bf1cf2a59608c3033
|
data/lib/avm/app_src.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/apps/sources/configuration'
|
4
|
+
require 'eac_launcher/paths/real'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
require 'avm/projects/stereotypes'
|
7
|
+
require 'i18n'
|
8
|
+
|
9
|
+
module Avm
|
10
|
+
class AppSrc
|
11
|
+
enable_simple_cache
|
12
|
+
common_constructor :path do
|
13
|
+
self.path = path.to_pathname
|
14
|
+
source_stereotypes_mixins
|
15
|
+
end
|
16
|
+
|
17
|
+
delegate :to_s, to: :path
|
18
|
+
|
19
|
+
def locale
|
20
|
+
configuration.if_present(&:locale) || ::I18n.default_locale
|
21
|
+
end
|
22
|
+
|
23
|
+
# Backward compatibility with [EacLauncher::Paths::Logical].
|
24
|
+
# @return [EacLauncher::Paths::Real].
|
25
|
+
def real
|
26
|
+
::EacLauncher::Paths::Real.new(path.to_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
def run_job(job, job_args = [])
|
30
|
+
stereotypes.each { |stereotype| run_stereotype_job(stereotype, job, job_args) }
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
# @return [Avm::Apps::Sources::Configuration]
|
36
|
+
def configuration_uncached
|
37
|
+
::Avm::Apps::Sources::Configuration.find_in_path(path)
|
38
|
+
end
|
39
|
+
|
40
|
+
def run_stereotype_job(stereotype, job, job_args)
|
41
|
+
job_class_method = "#{job}_class"
|
42
|
+
if stereotype.send(job_class_method).present?
|
43
|
+
puts stereotype.label + ": #{job} class found. Running..."
|
44
|
+
stereotype.send(job_class_method).new(self, *job_args).run
|
45
|
+
else
|
46
|
+
puts stereotype.label + ": #{job} class not found"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def stereotypes_uncached
|
51
|
+
::Avm::Projects::Stereotypes.list.select { |s| s.match?(self) }
|
52
|
+
end
|
53
|
+
|
54
|
+
def source_stereotypes_mixins
|
55
|
+
stereotypes.each do |s|
|
56
|
+
s.local_project_mixin_module.if_present { |v| singleton_class.include(v) }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/lib/avm/core_ext.rb
ADDED
data/lib/avm/docker/runner.rb
CHANGED
@@ -1,33 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
3
|
+
require 'avm/core_ext'
|
5
4
|
require 'avm/docker/registry'
|
6
5
|
|
7
6
|
module Avm
|
8
7
|
module Docker
|
9
|
-
class Runner
|
8
|
+
class Runner
|
10
9
|
enable_console_speaker
|
11
10
|
enable_simple_cache
|
12
11
|
|
13
|
-
|
14
|
-
Manipulate Docker images.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
-r --run Run or start a container with builded image.
|
25
|
-
-B --build-arg=<build-arg> Argument for "docker build".
|
26
|
-
-E --entrypoint-arg=<run-arg> Argument for entrypoint on "docker run"
|
27
|
-
-c --clear Remove container if exist before run.
|
28
|
-
-S --no-snapshot Does not add "-snapshot" to image tag.
|
29
|
-
-V --no-version Does not add version to image tag.
|
30
|
-
DOCOPT
|
12
|
+
runner_with :help do
|
13
|
+
desc 'Manipulate Docker images.'
|
14
|
+
arg_opt '-n', '--registry-name', 'Docker registry\'s name.'
|
15
|
+
bool_opt '-p', '--push', 'Push the image to Docker registry.'
|
16
|
+
bool_opt '-r', '--run', 'Run or start a container with builded image.'
|
17
|
+
arg_opt '-B', '--build-arg', 'Argument for "docker build".', repeat: true
|
18
|
+
arg_opt '-E', '--entrypoint-arg', 'Argument for entrypoint on "docker run"', repeat: true
|
19
|
+
bool_opt '-c', '--clear', 'Remove container if exist before run.'
|
20
|
+
bool_opt '-S', '--no-snapshot', 'Does not add "-snapshot" to image tag.'
|
21
|
+
bool_opt '-V', '--no-version', 'Does not add version to image tag.'
|
22
|
+
end
|
31
23
|
|
32
24
|
def run
|
33
25
|
setup
|
@@ -61,42 +53,42 @@ module Avm
|
|
61
53
|
end
|
62
54
|
|
63
55
|
def build_args
|
64
|
-
|
56
|
+
parsed.build_arg
|
65
57
|
end
|
66
58
|
|
67
59
|
def entrypoint_args
|
68
|
-
|
60
|
+
parsed.entrypoint_arg
|
69
61
|
end
|
70
62
|
|
71
63
|
def push
|
72
|
-
instance.docker_image.push if
|
64
|
+
instance.docker_image.push if parsed.push?
|
73
65
|
end
|
74
66
|
|
75
67
|
def container_run
|
76
|
-
return unless
|
68
|
+
return unless parsed.run?
|
77
69
|
|
78
70
|
instance.docker_container.run(
|
79
71
|
entrypoint_args: entrypoint_args,
|
80
|
-
clear:
|
72
|
+
clear: parsed.clear?
|
81
73
|
)
|
82
74
|
end
|
83
75
|
|
84
76
|
def registry_uncached
|
85
|
-
|
77
|
+
parsed.registry_name.if_present(::Avm::Docker::Registry.default) do |v|
|
86
78
|
::Avm::Docker::Registry.new(v)
|
87
79
|
end
|
88
80
|
end
|
89
81
|
|
90
82
|
def snapshot?
|
91
|
-
!
|
83
|
+
!parsed.no_snapshot?
|
92
84
|
end
|
93
85
|
|
94
86
|
def version?
|
95
|
-
!
|
87
|
+
!parsed.no_version?
|
96
88
|
end
|
97
89
|
|
98
90
|
def instance
|
99
|
-
|
91
|
+
runner_context.call(:instance)
|
100
92
|
end
|
101
93
|
end
|
102
94
|
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_webapp_base0/deploy'
|
4
|
-
require 'avm/eac_asciidoctor_base0/
|
5
|
-
require 'avm/eac_asciidoctor_base0/build'
|
4
|
+
require 'avm/eac_asciidoctor_base0/sources/base'
|
5
|
+
require 'avm/eac_asciidoctor_base0/sources/build'
|
6
6
|
|
7
7
|
module Avm
|
8
8
|
module EacAsciidoctorBase0
|
9
9
|
class Deploy < ::Avm::EacWebappBase0::Deploy
|
10
10
|
def build_content
|
11
|
-
::Avm::EacAsciidoctorBase0::Build.new(
|
11
|
+
::Avm::EacAsciidoctorBase0::Sources::Build.new(
|
12
12
|
project,
|
13
|
-
::Avm::EacAsciidoctorBase0::Build::OPTION_TARGET_DIRECTORY => build_dir
|
13
|
+
::Avm::EacAsciidoctorBase0::Sources::Build::OPTION_TARGET_DIRECTORY => build_dir
|
14
14
|
).run
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def project_uncached
|
20
|
-
::Avm::EacAsciidoctorBase0::
|
20
|
+
::Avm::EacAsciidoctorBase0::Sources::Base.new(
|
21
21
|
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
22
22
|
)
|
23
23
|
end
|
@@ -9,6 +9,7 @@ require 'avm/eac_webapp_base0/deploy/file_unit'
|
|
9
9
|
module Avm
|
10
10
|
module EacWebappBase0
|
11
11
|
class Instance < ::Avm::Instances::Base
|
12
|
+
require_sub __FILE__
|
12
13
|
include ::Avm::Postgresql::InstanceWith
|
13
14
|
|
14
15
|
FILES_UNITS = [].freeze
|
@@ -26,8 +27,10 @@ module Avm
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def run_subcommand(subcommand_class, argv)
|
29
|
-
|
30
|
-
|
30
|
+
subcommand_class.create(
|
31
|
+
argv: argv,
|
32
|
+
parent: ::Avm::EacWebappBase0::Instance::SubcommandParent.new(self)
|
33
|
+
).run
|
31
34
|
end
|
32
35
|
|
33
36
|
def data_package
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacWebappBase0
|
7
|
+
class Instance < ::Avm::Instances::Base
|
8
|
+
class SubcommandParent
|
9
|
+
enable_simple_cache
|
10
|
+
common_constructor :instance
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def runner_context_uncached
|
15
|
+
::EacCli::Runner::Context.new(self, argv: runner_argv)
|
16
|
+
end
|
17
|
+
|
18
|
+
def runner_argv
|
19
|
+
[instance.class.name.split('::')[-2].dasherize, instance.id]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -15,7 +15,7 @@ module Avm
|
|
15
15
|
|
16
16
|
runner_with :help do
|
17
17
|
desc 'Dump utility for EacRailsBase instance.'
|
18
|
-
bool_opt '-w', 'rewrite', 'Forces dump overwrite.'
|
18
|
+
bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
|
19
19
|
arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
|
20
20
|
end
|
21
21
|
|
@@ -9,7 +9,7 @@ module Avm
|
|
9
9
|
class Runner < ::Avm::Instances::Runner
|
10
10
|
class Data
|
11
11
|
class Load
|
12
|
-
runner_with
|
12
|
+
runner_with :help do
|
13
13
|
desc 'Load utility for EacRailsBase instance.'
|
14
14
|
arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
|
15
15
|
pos_arg :dump_path, optional: true
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/apps/sources/configuration'
|
4
4
|
require 'avm/result'
|
5
5
|
require 'eac_ruby_utils/fs/temp'
|
6
6
|
|
@@ -35,7 +35,7 @@ module Avm
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def configuration_uncached
|
38
|
-
::Avm::
|
38
|
+
::Avm::Apps::Sources::Configuration.find_by_path(@git)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/avm/instances/base.rb
CHANGED
@@ -3,16 +3,13 @@
|
|
3
3
|
require 'eac_ruby_utils/require_sub'
|
4
4
|
require 'eac_ruby_utils/simple_cache'
|
5
5
|
require 'avm/instances/entries'
|
6
|
-
require 'avm/instances/entry_keys'
|
7
|
-
::EacRubyUtils.require_sub(__FILE__)
|
8
6
|
|
9
7
|
module Avm
|
10
8
|
module Instances
|
11
9
|
class Base
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
include ::Avm::Instances::Base::Dockerizable
|
10
|
+
enable_listable
|
11
|
+
enable_simple_cache
|
12
|
+
require_sub __FILE__, include_modules: true
|
16
13
|
include ::Avm::Instances::Entries
|
17
14
|
|
18
15
|
lists.add_string :access, :local, :ssh
|
@@ -36,11 +33,8 @@ module Avm
|
|
36
33
|
end
|
37
34
|
end
|
38
35
|
|
39
|
-
|
40
|
-
|
41
|
-
def initialize(application, suffix)
|
42
|
-
@application = application
|
43
|
-
@suffix = suffix.to_s
|
36
|
+
common_constructor :application, :suffix do
|
37
|
+
self.suffix = suffix.to_s
|
44
38
|
end
|
45
39
|
|
46
40
|
def id
|
@@ -63,7 +57,7 @@ module Avm
|
|
63
57
|
private
|
64
58
|
|
65
59
|
def source_instance_uncached
|
66
|
-
::Avm::Instances::Base.by_id(
|
60
|
+
::Avm::Instances::Base.by_id(source_instance_id)
|
67
61
|
end
|
68
62
|
end
|
69
63
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/entry_keys'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Instances
|
7
|
+
class Base
|
8
|
+
module EntryKeys
|
9
|
+
::Avm::Instances::EntryKeys.all.each do |key|
|
10
|
+
define_method key.to_s.variableize do
|
11
|
+
read_entry(key)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
File without changes
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Launcher
|
7
|
+
module Instances
|
8
|
+
class RunnerHelper
|
9
|
+
def context
|
10
|
+
@context ||= ::EacLauncher::Context.current
|
11
|
+
end
|
12
|
+
|
13
|
+
def find_instances(instance_name)
|
14
|
+
context.instances.select { |instance| instance_match?(instance, instance_name) }
|
15
|
+
end
|
16
|
+
|
17
|
+
def instance_match?(instance, instance_name)
|
18
|
+
::File.fnmatch?(instance_name, instance.name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def instances
|
22
|
+
if parsed.all?
|
23
|
+
context.instances
|
24
|
+
elsif parsed.pending?
|
25
|
+
context.pending_instances
|
26
|
+
else
|
27
|
+
parsed.instance_path.flat_map { |p| find_instances(p) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def instance_stereotypes(instance)
|
32
|
+
instance.stereotypes.map(&:label).join(', ')
|
33
|
+
end
|
34
|
+
|
35
|
+
def instance_label(instance)
|
36
|
+
"#{instance.name} [#{instance_stereotypes(instance)}]"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|