avm-tools 0.71.0 → 0.75.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/{stereotypes/eac_rails_base0.rb → eac_rails_base0.rb} +1 -3
  3. data/lib/avm/eac_rails_base0/instance.rb +2 -5
  4. data/lib/avm/{rails/runners.rb → eac_rails_base1.rb} +2 -4
  5. data/lib/avm/{rails → eac_rails_base1}/instance.rb +8 -3
  6. data/lib/avm/eac_rails_base1/runner.rb +12 -0
  7. data/lib/avm/eac_rails_base1/runner/bundle.rb +28 -0
  8. data/lib/avm/eac_rails_base1/runner/code_runner.rb +28 -0
  9. data/lib/avm/eac_rails_base1/runner_with/bundle.rb +57 -0
  10. data/lib/avm/{stereotypes/rails.rb → eac_redmine_base0.rb} +2 -4
  11. data/lib/avm/eac_redmine_base0/instance.rb +2 -4
  12. data/lib/avm/{stereotypes/eac_ubuntu_base0.rb → eac_ubuntu_base0.rb} +1 -3
  13. data/lib/avm/{stereotypes/eac_webapp_base0.rb → eac_webapp_base0.rb} +1 -3
  14. data/lib/avm/eac_webapp_base0/deploy.rb +17 -40
  15. data/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
  16. data/lib/avm/eac_webapp_base0/deploy/git_info.rb +13 -0
  17. data/lib/avm/eac_webapp_base0/deploy/version.rb +4 -0
  18. data/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
  19. data/lib/avm/eac_webapp_base0/instance.rb +2 -2
  20. data/lib/avm/eac_webapp_base0/runner.rb +12 -0
  21. data/lib/avm/eac_webapp_base0/runner/apache_host.rb +2 -3
  22. data/lib/avm/eac_webapp_base0/runner/data.rb +1 -1
  23. data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
  24. data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
  25. data/lib/avm/eac_webapp_base0/runner/deploy.rb +3 -16
  26. data/lib/avm/eac_wordpress_base0.rb +9 -0
  27. data/lib/avm/eac_wordpress_base0/apache_host.rb +25 -0
  28. data/lib/avm/eac_wordpress_base0/deploy.rb +10 -0
  29. data/lib/avm/eac_wordpress_base0/instance.rb +24 -0
  30. data/lib/avm/eac_writings_base0.rb +9 -0
  31. data/lib/avm/eac_writings_base0/apache_host.rb +17 -0
  32. data/lib/avm/eac_writings_base0/commons.rb +12 -0
  33. data/lib/avm/eac_writings_base0/deploy.rb +36 -0
  34. data/lib/avm/eac_writings_base0/file_build.rb +45 -0
  35. data/lib/avm/eac_writings_base0/file_build/base_stereotype.rb +19 -0
  36. data/lib/avm/eac_writings_base0/file_build/chapter_index.rb +23 -0
  37. data/lib/avm/eac_writings_base0/file_build/tex_source.rb +33 -0
  38. data/lib/avm/eac_writings_base0/instance.rb +11 -0
  39. data/lib/avm/eac_writings_base0/project.rb +33 -0
  40. data/lib/avm/eac_writings_base0/project_build.rb +117 -0
  41. data/lib/avm/eac_writings_base0/project_build/chapters_content.rb +47 -0
  42. data/lib/avm/eac_writings_base0/project_build/copy_files.rb +42 -0
  43. data/lib/avm/executables.rb +1 -1
  44. data/lib/avm/files/appendable.rb +55 -0
  45. data/lib/avm/files/appendable/file_content.rb +24 -0
  46. data/lib/avm/files/appendable/plain_directory.rb +25 -0
  47. data/lib/avm/files/appendable/resource_base.rb +13 -0
  48. data/lib/avm/files/appendable/tar_output_command.rb +26 -0
  49. data/lib/avm/files/appendable/templatized_directory.rb +28 -0
  50. data/lib/avm/files/appender.rb +11 -0
  51. data/lib/avm/files/deploy.rb +72 -0
  52. data/lib/avm/git/commit/deploy.rb +8 -61
  53. data/lib/avm/instances/application.rb +4 -0
  54. data/lib/avm/instances/base.rb +2 -1
  55. data/lib/avm/instances/base/auto_values.rb +2 -1
  56. data/lib/avm/instances/base/auto_values/access.rb +5 -4
  57. data/lib/avm/instances/base/auto_values/admin.rb +2 -2
  58. data/lib/avm/instances/base/auto_values/database.rb +1 -1
  59. data/lib/avm/instances/base/auto_values/filesystem.rb +6 -2
  60. data/lib/avm/instances/base/auto_values/mailer.rb +34 -0
  61. data/lib/avm/instances/base/auto_values/ruby.rb +1 -1
  62. data/lib/avm/instances/base/auto_values/system.rb +2 -2
  63. data/lib/avm/instances/entry.rb +7 -1
  64. data/lib/avm/instances/entry_keys.rb +42 -7
  65. data/lib/avm/instances/runner.rb +40 -0
  66. data/lib/avm/{stereotypes/postgresql.rb → postgresql.rb} +1 -3
  67. data/lib/avm/postgresql/instance.rb +63 -0
  68. data/lib/avm/postgresql/instance/data_unit.rb +39 -0
  69. data/lib/avm/postgresql/instance_with.rb +18 -0
  70. data/lib/avm/projects/stereotypes/git_subtree/publish.rb +2 -0
  71. data/lib/avm/projects/stereotypes/git_subtree/warp.rb +3 -0
  72. data/lib/avm/tools/runner.rb +3 -3
  73. data/lib/avm/tools/runner/eac_rails_base0.rb +5 -18
  74. data/lib/avm/tools/runner/eac_rails_base0/apache_path.rb +1 -1
  75. data/lib/avm/tools/runner/eac_rails_base0/bundle.rb +3 -3
  76. data/lib/avm/tools/runner/eac_rails_base0/rails_server.rb +7 -12
  77. data/lib/avm/tools/runner/eac_rails_base0/runner.rb +3 -3
  78. data/lib/avm/tools/runner/eac_redmine_base0.rb +5 -23
  79. data/lib/avm/tools/runner/eac_redmine_base0/core_update.rb +1 -1
  80. data/lib/avm/tools/runner/eac_redmine_base0/docker.rb +1 -1
  81. data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +3 -3
  82. data/lib/avm/tools/runner/eac_wordpress_base0.rb +5 -24
  83. data/lib/avm/tools/runner/{eac_rails_base0/data.rb → eac_writings_base0.rb} +4 -4
  84. data/lib/avm/tools/runner/git/deploy.rb +1 -1
  85. data/lib/avm/tools/runner/instance.rb +28 -0
  86. data/lib/avm/tools/runner/instance/info.rb +44 -0
  87. data/lib/avm/tools/runner/local_project/eac_writings_base0.rb +35 -0
  88. data/lib/avm/tools/runner/local_project/eac_writings_base0/build_chapters.rb +48 -0
  89. data/lib/avm/tools/runner/local_project/eac_writings_base0/build_single.rb +37 -0
  90. data/lib/avm/tools/runner/local_project/eac_writings_base0/info.rb +36 -0
  91. data/lib/avm/tools/version.rb +1 -1
  92. data/template/avm/eac_rails_base0/deploy/config/envvars.d/email.yml.template +11 -0
  93. data/template/avm/{stereotypes/eac_ubuntu_base0 → eac_ubuntu_base0}/docker_image/Dockerfile +0 -0
  94. data/template/avm/{stereotypes/eac_wordpress_base0 → eac_wordpress_base0}/deploy/wp-config.php.template +0 -0
  95. data/template/avm/eac_writings_base0/commons/all.tex +5 -0
  96. data/template/avm/eac_writings_base0/commons/ebook.tex +11 -0
  97. data/template/avm/eac_writings_base0/commons/images.tex +11 -0
  98. data/template/avm/eac_writings_base0/commons/links.tex +2 -0
  99. data/template/avm/eac_writings_base0/commons/portuguese.tex +8 -0
  100. data/template/avm/eac_writings_base0/commons/source_code.tex +21 -0
  101. data/template/avm/eac_writings_base0/commons/source_code/java.tex +15 -0
  102. data/template/avm/eac_writings_base0/commons/utils.tex +6 -0
  103. data/template/avm/eac_writings_base0/deploy/index.html.template +9 -0
  104. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +12 -0
  105. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  106. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb +19 -0
  107. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/base.rb +43 -0
  108. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb +12 -31
  109. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +4 -1
  110. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/clearable_directory.rb +57 -0
  111. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +21 -58
  112. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +8 -0
  113. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/node.rb +67 -0
  114. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/path_search.rb +39 -0
  115. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +4 -0
  116. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  117. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb +16 -0
  118. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb +15 -0
  119. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb +52 -13
  120. metadata +72 -35
  121. data/lib/avm/git/commit/deploy/appended.rb +0 -37
  122. data/lib/avm/git/commit/deploy/appended/base.rb +0 -17
  123. data/lib/avm/git/commit/deploy/appended/directory.rb +0 -32
  124. data/lib/avm/git/commit/deploy/appended/file_content.rb +0 -28
  125. data/lib/avm/rails/runners/bundle.rb +0 -35
  126. data/lib/avm/rails/runners/runner.rb +0 -48
  127. data/lib/avm/stereotypes/eac_redmine_base0.rb +0 -11
  128. data/lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb +0 -27
  129. data/lib/avm/stereotypes/eac_wordpress_base0/deploy.rb +0 -12
  130. data/lib/avm/stereotypes/eac_wordpress_base0/instance.rb +0 -26
  131. data/lib/avm/stereotypes/postgresql/instance.rb +0 -65
  132. data/lib/avm/stereotypes/postgresql/instance/data_unit.rb +0 -41
  133. data/lib/avm/stereotypes/postgresql/instance_with.rb +0 -20
  134. data/lib/avm/tools/runner/eac_rails_base0/apache_host.rb +0 -16
  135. data/lib/avm/tools/runner/eac_rails_base0/deploy.rb +0 -15
  136. data/lib/avm/tools/runner/eac_redmine_base0/bundle.rb +0 -14
  137. data/lib/avm/tools/runner/eac_redmine_base0/data.rb +0 -27
  138. data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +0 -16
  139. data/lib/avm/tools/runner/eac_redmine_base0/deploy.rb +0 -15
  140. data/lib/avm/tools/runner/eac_redmine_base0/runner.rb +0 -14
  141. data/lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb +0 -17
  142. data/lib/avm/tools/runner/eac_wordpress_base0/data.rb +0 -15
  143. data/lib/avm/tools/runner/eac_wordpress_base0/deploy.rb +0 -15
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/data/instance/unit'
4
+
5
+ module Avm
6
+ module Postgresql
7
+ class Instance
8
+ class DataUnit < ::Avm::Data::Instance::Unit
9
+ EXTENSION = '.pgdump.gz'
10
+
11
+ before_load :clear_database
12
+
13
+ def dump_command
14
+ instance.dump_gzip_command
15
+ end
16
+
17
+ def load_command
18
+ instance.psql_command.prepend(['gzip', '-d', '@ESC_|'])
19
+ end
20
+
21
+ private
22
+
23
+ def clear_database
24
+ info 'Clearing database (Dropping all tables)...'
25
+ run_sql(drop_all_tables_sql).if_present { |v| run_sql(v) }
26
+ end
27
+
28
+ def drop_all_tables_sql
29
+ "select 'drop table \"' || tablename || '\" cascade;' from pg_tables " \
30
+ "where schemaname = 'public';"
31
+ end
32
+
33
+ def run_sql(sql)
34
+ instance.psql_command_command(sql).execute!
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/entry_keys'
4
+ require 'avm/postgresql/instance'
5
+
6
+ module Avm
7
+ module Postgresql
8
+ module InstanceWith
9
+ def pg
10
+ @pg ||= ::Avm::Postgresql::Instance.new(
11
+ host_env, user: read_entry(::Avm::Instances::EntryKeys::DATABASE_USERNAME),
12
+ password: read_entry(::Avm::Instances::EntryKeys::DATABASE_PASSWORD),
13
+ name: read_entry(::Avm::Instances::EntryKeys::DATABASE_NAME)
14
+ )
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_launcher/git/publish_base'
4
+
3
5
  module Avm
4
6
  module Projects
5
7
  module Stereotypes
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_launcher/git/warp_base'
4
+ require 'eac_launcher/git/sub_warp_base'
5
+
3
6
  module Avm
4
7
  module Projects
5
8
  module Stereotypes
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/console/docopt_runner'
4
- require 'eac_ruby_utils/require_sub'
5
- ::EacRubyUtils.require_sub(__FILE__)
6
3
  require 'avm/self'
7
4
  require 'avm/tools/version'
8
5
  require 'eac_ruby_base0/runner'
6
+ require 'eac_ruby_utils/console/docopt_runner'
7
+ require 'eac_ruby_utils/core_ext'
9
8
 
10
9
  module Avm
11
10
  module Tools
12
11
  class Runner < ::EacRubyUtils::Console::DocoptRunner
13
12
  include ::EacRubyBase0::Runner
13
+ require_sub __FILE__
14
14
 
15
15
  runner_definition do
16
16
  desc 'Tools for AVM.'
@@ -1,28 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/core_ext'
3
+ require 'avm/eac_rails_base0'
4
+ require 'avm/eac_rails_base1/runner'
4
5
  require 'eac_ruby_utils/console/docopt_runner'
5
- require 'eac_ruby_utils/simple_cache'
6
- require 'avm/eac_rails_base0/instance'
7
- ::EacRubyUtils.require_sub(__FILE__)
6
+ require 'eac_ruby_utils/core_ext'
8
7
 
9
8
  module Avm
10
9
  module Tools
11
10
  class Runner < ::EacRubyUtils::Console::DocoptRunner
12
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
13
- runner_with
14
-
15
- runner_definition do
16
- desc 'Utilities for EacRailsBase0 instances.'
17
- pos_arg :instance_id
18
- subcommands
19
- end
20
-
21
- private
22
-
23
- def instance_uncached
24
- ::Avm::EacRailsBase0::Instance.by_id(options['<instance_id>'])
25
- end
11
+ class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
12
+ require_sub __FILE__
26
13
  end
27
14
  end
28
15
  end
@@ -8,7 +8,7 @@ require 'avm/eac_rails_base0/apache_path'
8
8
  module Avm
9
9
  module Tools
10
10
  class Runner < ::EacRubyUtils::Console::DocoptRunner
11
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
11
+ class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
12
12
  class ApachePath < ::EacRubyUtils::Console::DocoptRunner
13
13
  runner_with
14
14
 
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/rails/runners/bundle'
3
+ require 'avm/eac_rails_base1/runner/bundle'
4
4
 
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner < ::EacRubyUtils::Console::DocoptRunner
8
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
9
- class Bundle < ::Avm::Rails::Runners::Bundle
8
+ class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
9
+ class Bundle < ::Avm::EacRailsBase1::Runner::Bundle
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/eac_rails_base1/runner_with/bundle'
3
4
  require 'avm/instances/entry_keys'
4
5
  require 'eac_cli/core_ext'
5
6
  require 'eac_ruby_utils/console/docopt_runner'
@@ -8,31 +9,25 @@ require 'shellwords'
8
9
  module Avm
9
10
  module Tools
10
11
  class Runner < ::EacRubyUtils::Console::DocoptRunner
11
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
12
+ class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
12
13
  class RailsServer
13
- runner_with
14
-
14
+ DEFAULT_RAILS_ENVIRONMENT = 'development'
15
+ runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle
15
16
  runner_definition do
16
17
  desc 'Run the embbeded Rails web server.'
17
- arg_opt '-e', '--environment', 'Specifies the environment to run this server under' \
18
- ' (development/test/production).'
19
18
  end
20
19
 
21
20
  def run
21
+ infov 'Environment', rails_environment
22
22
  infov 'Bundle args', ::Shellwords.join(bundle_args)
23
- infov 'Result', command.system
23
+ infov 'Result', bundle_command.system
24
24
  end
25
25
 
26
26
  protected
27
27
 
28
28
  def bundle_args
29
29
  ['exec', 'rails', 'server', '--port',
30
- runner_context.call(:instance).read_entry(::Avm::Instances::EntryKeys::WEB_PORT)] +
31
- parsed.environment.if_present([]) { |v| ['--environment', v] }
32
- end
33
-
34
- def command
35
- runner_context.call(:instance).bundle(*bundle_args).chdir_root
30
+ runner_context.call(:instance).read_entry(::Avm::Instances::EntryKeys::WEB_PORT)]
36
31
  end
37
32
  end
38
33
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/rails/runners/runner'
3
+ require 'avm/eac_rails_base1/runner/code_runner'
4
4
 
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner < ::EacRubyUtils::Console::DocoptRunner
8
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
9
- class Runner < ::Avm::Rails::Runners::Runner
8
+ class EacRailsBase0 < ::Avm::EacRailsBase1::Runner
9
+ class Runner < ::Avm::EacRailsBase1::Runner::CodeRunner
10
10
  end
11
11
  end
12
12
  end
@@ -1,33 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/eac_rails_base1/runner'
4
+ require 'avm/eac_redmine_base0'
3
5
  require 'eac_ruby_utils/console/docopt_runner'
4
- require 'eac_ruby_utils/simple_cache'
5
- require 'avm/eac_redmine_base0/instance'
6
- require 'eac_ruby_utils/require_sub'
7
- ::EacRubyUtils.require_sub(__FILE__)
6
+ require 'eac_ruby_utils/core_ext'
8
7
 
9
8
  module Avm
10
9
  module Tools
11
10
  class Runner < ::EacRubyUtils::Console::DocoptRunner
12
- class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
13
- include ::EacRubyUtils::SimpleCache
14
-
15
- DOC = <<~DOCOPT
16
- Utilities for EacRedmineBase0 instances.
17
-
18
- Usage:
19
- __PROGRAM__ [options] <instance_id> __SUBCOMMANDS__
20
- __PROGRAM__ -h | --help
21
-
22
- Options:
23
- -h --help Show this screen.
24
- DOCOPT
25
-
26
- private
27
-
28
- def instance_uncached
29
- ::Avm::EacRedmineBase0::Instance.by_id(options['<instance_id>'])
30
- end
11
+ class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
12
+ require_sub __FILE__
31
13
  end
32
14
  end
33
15
  end
@@ -8,7 +8,7 @@ require 'eac_ruby_utils/core_ext'
8
8
  module Avm
9
9
  module Tools
10
10
  class Runner < ::EacRubyUtils::Console::DocoptRunner
11
- class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
11
+ class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
12
12
  class CoreUpdate < ::EacRubyUtils::Console::DocoptRunner
13
13
  include ::EacCli::DefaultRunner
14
14
 
@@ -5,7 +5,7 @@ require 'avm/docker/runner'
5
5
  module Avm
6
6
  module Tools
7
7
  class Runner < ::EacRubyUtils::Console::DocoptRunner
8
- class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
8
+ class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
9
9
  class Docker < ::Avm::Docker::Runner
10
10
  end
11
11
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/rails/runners/runner'
3
+ require 'avm/eac_rails_base1/runner/code_runner'
4
4
  require 'eac_cli/default_runner'
5
5
 
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner < ::EacRubyUtils::Console::DocoptRunner
9
- class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
10
- class ProjectRename < ::Avm::Rails::Runners::Runner
9
+ class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner
10
+ class ProjectRename < ::Avm::EacRailsBase1::Runner::CodeRunner
11
11
  include ::EacCli::DefaultRunner
12
12
 
13
13
  runner_definition do
@@ -1,34 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/eac_webapp_base0/runner'
4
+ require 'avm/eac_wordpress_base0'
3
5
  require 'eac_ruby_utils/console/docopt_runner'
4
- require 'eac_ruby_utils/simple_cache'
5
- require 'avm/stereotypes/eac_wordpress_base0/instance'
6
- require 'avm/tools/runner/eac_wordpress_base0/apache_host'
7
- require 'avm/tools/runner/eac_wordpress_base0/data'
8
- require 'avm/tools/runner/eac_wordpress_base0/deploy'
6
+ require 'eac_ruby_utils/core_ext'
9
7
 
10
8
  module Avm
11
9
  module Tools
12
10
  class Runner < ::EacRubyUtils::Console::DocoptRunner
13
- class EacWordpressBase0 < ::EacRubyUtils::Console::DocoptRunner
14
- include ::EacRubyUtils::SimpleCache
15
-
16
- DOC = <<~DOCOPT
17
- Utilities for EacWordpressBase0 instances.
18
-
19
- Usage:
20
- __PROGRAM__ [options] <instance_id> __SUBCOMMANDS__
21
- __PROGRAM__ -h | --help
22
-
23
- Options:
24
- -h --help Show this screen.
25
- DOCOPT
26
-
27
- private
28
-
29
- def instance_uncached
30
- ::Avm::Stereotypes::EacWordpressBase0::Instance.by_id(options['<instance_id>'])
31
- end
11
+ class EacWordpressBase0 < ::Avm::EacWebappBase0::Runner
12
+ require_sub __FILE__
32
13
  end
33
14
  end
34
15
  end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_webapp_base0/runner/data'
3
+ require 'avm/eac_webapp_base0/runner'
4
+ require 'avm/eac_writings_base0'
4
5
  require 'eac_ruby_utils/console/docopt_runner'
5
6
 
6
7
  module Avm
7
8
  module Tools
8
9
  class Runner < ::EacRubyUtils::Console::DocoptRunner
9
- class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
10
- class Data < ::Avm::EacWebappBase0::Runner::Data
11
- end
10
+ class EacWritingsBase0 < ::Avm::EacWebappBase0::Runner
11
+ require_sub __FILE__
12
12
  end
13
13
  end
14
14
  end
@@ -88,7 +88,7 @@ module Avm
88
88
  def deploy
89
89
  ::Avm::Git::Commit.new(git, reference_sha1)
90
90
  .deploy_to_url(target_url)
91
- .append_directories(appended_directories)
91
+ .append_templatized_directories(appended_directories)
92
92
  .variables_source_set(variables_source)
93
93
  .run
94
94
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/base'
4
+ require 'eac_cli/core_ext'
5
+ require 'eac_ruby_utils/console/docopt_runner'
6
+
7
+ module Avm
8
+ module Tools
9
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
10
+ class Instance < ::EacRubyUtils::Console::DocoptRunner
11
+ require_sub __FILE__
12
+ runner_with
13
+
14
+ runner_definition do
15
+ desc 'Utilities for generic instances.'
16
+ pos_arg :instance_id
17
+ subcommands
18
+ end
19
+
20
+ private
21
+
22
+ def instance_uncached
23
+ ::Avm::Instances::Base.by_id(options['<instance_id>'])
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/entry_keys'
4
+ require 'eac_cli/core_ext'
5
+ require 'eac_ruby_utils/console/docopt_runner'
6
+
7
+ module Avm
8
+ module Tools
9
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
10
+ class Instance < ::EacRubyUtils::Console::DocoptRunner
11
+ class Info < ::EacRubyUtils::Console::DocoptRunner
12
+ runner_with
13
+
14
+ runner_definition do
15
+ desc 'Show info about a instance.'
16
+ end
17
+
18
+ def run
19
+ base_banner
20
+ entry_keys_banner
21
+ end
22
+
23
+ private
24
+
25
+ def base_banner
26
+ infov 'ID', instance.id
27
+ infov 'Application ID', instance.application.id
28
+ infov 'Suffix', instance.suffix
29
+ end
30
+
31
+ def entry_keys_banner
32
+ ::Avm::Instances::EntryKeys.all.each do |key|
33
+ infov key, instance.read_entry_optional(key)
34
+ end
35
+ end
36
+
37
+ def instance
38
+ context(:instance)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_writings_base0/project'
4
+ require 'eac_cli/core_ext'
5
+ require 'eac_ruby_utils/console/docopt_runner'
6
+
7
+ module Avm
8
+ module Tools
9
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
10
+ class LocalProject < ::EacRubyUtils::Console::DocoptRunner
11
+ class EacWritingsBase0 < ::EacRubyUtils::Console::DocoptRunner
12
+ require_sub __FILE__
13
+ runner_with
14
+ enable_simple_cache
15
+
16
+ runner_definition do
17
+ desc 'EacWritingsBase0 utitilies for local projects.'
18
+ subcommands
19
+ end
20
+
21
+ def project_banner
22
+ infov 'Project', project.name
23
+ infov 'Path', project.root
24
+ end
25
+
26
+ private
27
+
28
+ def project_uncached
29
+ ::Avm::EacWritingsBase0::Project.new(context(:instance_path))
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end