avm-tools 0.118.0 → 0.120.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb +3 -3
  3. data/lib/avm/tools/app_src.rb +1 -5
  4. data/lib/avm/tools/runner/app_src/ruby.rb +0 -1
  5. data/lib/avm/tools/runner/app_src.rb +2 -0
  6. data/lib/avm/tools/version.rb +1 -1
  7. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/sources/base.rb +2 -2
  8. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +3 -3
  10. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  11. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/Gemfile +0 -0
  12. data/sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec +19 -0
  13. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/sources/base.rb +30 -0
  14. data/sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0/version.rb +7 -0
  15. data/sub/{avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb → avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb} +1 -1
  16. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/rubocop_spec.rb +0 -0
  17. data/sub/{avm-eac_rails_base1 → avm-eac_redmine_plugin_base0}/spec/spec_helper.rb +0 -0
  18. metadata +27 -223
  19. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +0 -29
  20. data/lib/avm/patches/eac_ruby_gems_utils.rb +0 -4
  21. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +0 -25
  22. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +0 -39
  23. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +0 -17
  24. data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +0 -73
  25. data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +0 -31
  26. data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +0 -19
  27. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +0 -26
  28. data/lib/avm/ruby/bundler/incompatible_parser.rb +0 -25
  29. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +0 -82
  30. data/sub/avm/Gemfile +0 -5
  31. data/sub/avm/avm.gemspec +0 -26
  32. data/sub/avm/lib/avm/data/instance/files_unit.rb +0 -40
  33. data/sub/avm/lib/avm/data/instance/package.rb +0 -18
  34. data/sub/avm/lib/avm/data/instance/unit.rb +0 -17
  35. data/sub/avm/lib/avm/data/instance.rb +0 -11
  36. data/sub/avm/lib/avm/data/package/dump.rb +0 -119
  37. data/sub/avm/lib/avm/data/package/load.rb +0 -48
  38. data/sub/avm/lib/avm/data/package.rb +0 -42
  39. data/sub/avm/lib/avm/data/rotate.rb +0 -107
  40. data/sub/avm/lib/avm/data/unit.rb +0 -94
  41. data/sub/avm/lib/avm/docker/container.rb +0 -50
  42. data/sub/avm/lib/avm/docker/image.rb +0 -71
  43. data/sub/avm/lib/avm/docker/runner.rb +0 -125
  44. data/sub/avm/lib/avm/docker.rb +0 -9
  45. data/sub/avm/lib/avm/executables.rb +0 -24
  46. data/sub/avm/lib/avm/instances/application.rb +0 -29
  47. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +0 -40
  48. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
  49. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +0 -26
  50. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +0 -76
  51. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +0 -43
  52. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +0 -34
  53. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +0 -15
  54. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +0 -15
  55. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +0 -23
  56. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +0 -46
  57. data/sub/avm/lib/avm/instances/base/auto_values.rb +0 -21
  58. data/sub/avm/lib/avm/instances/base/dockerizable.rb +0 -45
  59. data/sub/avm/lib/avm/instances/base/entry_keys.rb +0 -22
  60. data/sub/avm/lib/avm/instances/base.rb +0 -64
  61. data/sub/avm/lib/avm/instances/docker_image.rb +0 -15
  62. data/sub/avm/lib/avm/instances/entries.rb +0 -43
  63. data/sub/avm/lib/avm/instances/entry.rb +0 -60
  64. data/sub/avm/lib/avm/instances/entry_keys.rb +0 -60
  65. data/sub/avm/lib/avm/instances/runner.rb +0 -39
  66. data/sub/avm/lib/avm/instances.rb +0 -8
  67. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  68. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  69. data/sub/avm/lib/avm/jobs.rb +0 -9
  70. data/sub/avm/lib/avm/launcher/errors/base.rb +0 -10
  71. data/sub/avm/lib/avm/launcher/errors/non_project.rb +0 -15
  72. data/sub/avm/lib/avm/launcher/paths/real.rb +0 -44
  73. data/sub/avm/lib/avm/launcher/publish/check_result.rb +0 -67
  74. data/sub/avm/lib/avm/path_string.rb +0 -27
  75. data/sub/avm/lib/avm/registry/base.rb +0 -67
  76. data/sub/avm/lib/avm/registry.rb +0 -29
  77. data/sub/avm/lib/avm/result.rb +0 -86
  78. data/sub/avm/lib/avm/rspec/setup.rb +0 -22
  79. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +0 -11
  80. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +0 -14
  81. data/sub/avm/lib/avm/rspec.rb +0 -9
  82. data/sub/avm/lib/avm/runners/base.rb +0 -27
  83. data/sub/avm/lib/avm/scms/base.rb +0 -46
  84. data/sub/avm/lib/avm/scms/commit.rb +0 -43
  85. data/sub/avm/lib/avm/scms/inflector.rb +0 -22
  86. data/sub/avm/lib/avm/self/docker_image.rb +0 -14
  87. data/sub/avm/lib/avm/self/instance/entry_keys.rb +0 -12
  88. data/sub/avm/lib/avm/self/instance.rb +0 -31
  89. data/sub/avm/lib/avm/sources/base/configuration.rb +0 -45
  90. data/sub/avm/lib/avm/sources/base/instance.rb +0 -28
  91. data/sub/avm/lib/avm/sources/base/parent.rb +0 -31
  92. data/sub/avm/lib/avm/sources/base/subs.rb +0 -55
  93. data/sub/avm/lib/avm/sources/base/subs_paths.rb +0 -32
  94. data/sub/avm/lib/avm/sources/base/testing.rb +0 -21
  95. data/sub/avm/lib/avm/sources/base.rb +0 -44
  96. data/sub/avm/lib/avm/sources/configuration/locale.rb +0 -18
  97. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +0 -26
  98. data/sub/avm/lib/avm/sources/configuration/tests.rb +0 -29
  99. data/sub/avm/lib/avm/sources/configuration.rb +0 -59
  100. data/sub/avm/lib/avm/sources/tester.rb +0 -24
  101. data/sub/avm/lib/avm/sources/tests/builder.rb +0 -83
  102. data/sub/avm/lib/avm/sources/tests/performer.rb +0 -35
  103. data/sub/avm/lib/avm/sources/tests/result.rb +0 -15
  104. data/sub/avm/lib/avm/sources/tests/single.rb +0 -56
  105. data/sub/avm/lib/avm/sources/tests.rb +0 -11
  106. data/sub/avm/lib/avm/sources.rb +0 -9
  107. data/sub/avm/lib/avm/sync.rb +0 -94
  108. data/sub/avm/lib/avm/version.rb +0 -5
  109. data/sub/avm/lib/avm/version_number.rb +0 -45
  110. data/sub/avm/lib/avm.rb +0 -7
  111. data/sub/avm/spec/lib/avm/scms/base_spec.rb +0 -7
  112. data/sub/avm/spec/lib/avm/sources/base_spec.rb +0 -7
  113. data/sub/avm/spec/rubocop_spec.rb +0 -3
  114. data/sub/avm/spec/spec_helper.rb +0 -4
  115. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +0 -21
  116. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  117. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -24
  118. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  119. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  120. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  121. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  122. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  123. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  124. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  125. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  126. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +0 -12
  127. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +0 -27
  128. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +0 -47
  129. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/sources/base.rb +0 -27
  130. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  131. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  132. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  133. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +0 -7
  134. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +0 -9
  135. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +0 -12
  136. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +0 -6
  137. data/sub/avm-eac_ruby_base1/Gemfile +0 -5
  138. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +0 -21
  139. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +0 -56
  140. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +0 -19
  141. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +0 -34
  142. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +0 -11
  143. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +0 -31
  144. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +0 -17
  145. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +0 -41
  146. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop.rb +0 -55
  147. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -23
  148. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -50
  149. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +0 -38
  150. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +0 -56
  151. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -52
  152. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +0 -11
  153. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +0 -7
  154. data/sub/avm-eac_ruby_base1/locale/en.yaml +0 -8
  155. data/sub/avm-eac_ruby_base1/locale/pt-BR.yaml +0 -8
  156. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +0 -7
  157. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +0 -3
  158. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +0 -4
  159. data/sub/eac_ruby_base0/Gemfile +0 -5
  160. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +0 -21
  161. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +0 -87
  162. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +0 -34
  163. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +0 -5
  164. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +0 -31
  165. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +0 -10
  166. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +0 -4
  167. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
  168. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
  169. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +0 -4
  170. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec/setup.rb +0 -14
  171. data/sub/eac_ruby_base0/lib/eac_ruby_base0/rspec.rb +0 -9
  172. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +0 -92
  173. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +0 -42
  174. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
  175. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +0 -36
  176. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +0 -58
  177. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +0 -9
  178. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +0 -5
  179. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +0 -7
  180. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +0 -42
  181. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +0 -81
  182. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +0 -3
  183. data/sub/eac_ruby_base0/spec/spec_helper.rb +0 -4
  184. data/sub/eac_ruby_gems_utils/Gemfile +0 -5
  185. data/sub/eac_ruby_gems_utils/LICENCE +0 -16
  186. data/sub/eac_ruby_gems_utils/README.rdoc +0 -3
  187. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +0 -31
  188. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +0 -33
  189. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +0 -41
  190. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +0 -97
  191. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -57
  192. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +0 -25
  193. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +0 -48
  194. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +0 -25
  195. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +0 -84
  196. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +0 -21
  197. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +0 -9
  198. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +0 -5
  199. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +0 -7
  200. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +0 -3
  201. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +0 -14
  202. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +0 -7
  203. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +0 -20
  204. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +0 -4
  205. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +0 -5
  206. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +0 -19
  207. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +0 -14
  208. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +0 -5
  209. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +0 -5
  210. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +0 -5
  211. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +0 -16
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/instances/entry_keys'
4
-
5
- module Avm
6
- module Instances
7
- class Base
8
- module AutoValues
9
- module Filesystem
10
- def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
12
- ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
13
- end
14
-
15
- def auto_data_fs_path
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
17
- ::Avm::Instances::EntryKeys::DATA_FS_PATH) { |v| v + '/' + id }
18
- end
19
-
20
- def auto_fs_url
21
- auto_fs_url_with_ssh || auto_fs_url_without_ssh
22
- end
23
-
24
- def auto_fs_url_with_ssh
25
- read_entry_optional('ssh.url').if_present do |ssh_url|
26
- read_entry_optional('fs_path').if_present do |fs_path|
27
- "#{ssh_url}#{fs_path}"
28
- end
29
- end
30
- end
31
-
32
- def auto_fs_url_without_ssh
33
- return nil if read_entry_optional('ssh.url').present?
34
-
35
- read_entry_optional('fs_path').if_present do |fs_path|
36
- "file://#{fs_path}"
37
- end
38
- end
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/instances/entry'
4
- require 'avm/instances/entry_keys'
5
-
6
- module Avm
7
- module Instances
8
- class Base
9
- module AutoValues
10
- module Mailer
11
- ::Avm::Instances::EntryKeys.all.select { |c| c.to_s.start_with?('mailer.') }
12
- .reject { |c| c == ::Avm::Instances::EntryKeys::MAILER_ID }
13
- .each do |mailer_key|
14
- define_method ::Avm::Instances::Entry.auto_value_method_name(mailer_key) do
15
- mailer_auto_common(mailer_key)
16
- end
17
- end
18
-
19
- def auto_mailer_id
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
21
- ::Avm::Instances::EntryKeys::MAILER_ID) ||
22
- read_entry_optional(::Avm::Instances::EntryKeys::HOST_ID)
23
- end
24
-
25
- private
26
-
27
- def mailer_auto_common(mailer_key)
28
- inherited_entry_value(::Avm::Instances::EntryKeys::MAILER_ID, mailer_key)
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- class Base
6
- module AutoValues
7
- module Ruby
8
- def auto_ruby_version
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ruby.version')
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- class Base
6
- module AutoValues
7
- module Source
8
- def auto_source_instance_id
9
- "#{application.id}_dev"
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'addressable'
4
-
5
- module Avm
6
- module Instances
7
- class Base
8
- module AutoValues
9
- module System
10
- def auto_system_username
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.username') ||
12
- read_entry_optional('ssh.username')
13
- end
14
-
15
- def auto_system_groupname
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.groupname') ||
17
- read_entry_optional('system.username')
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'addressable'
4
- require 'avm/instances/entry_keys'
5
-
6
- module Avm
7
- module Instances
8
- class Base
9
- module AutoValues
10
- module Web
11
- def auto_web_authority
12
- web_url_as_uri(&:authority)
13
- end
14
-
15
- def auto_web_hostname
16
- web_url_as_uri(&:host)
17
- end
18
-
19
- def auto_web_path
20
- web_url_as_uri(&:path)
21
- end
22
-
23
- def auto_web_port
24
- web_url_as_uri(&:port)
25
- end
26
-
27
- def auto_web_scheme
28
- web_url_as_uri(&:scheme)
29
- end
30
-
31
- def auto_web_userinfo
32
- web_url_as_uri(&:userinfo)
33
- end
34
-
35
- private
36
-
37
- def web_url_as_uri
38
- read_entry_optional(::Avm::Instances::EntryKeys::WEB_URL).if_present do |v|
39
- yield(::Addressable::URI.parse(v))
40
- end
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
5
-
6
- module Avm
7
- module Instances
8
- class Base
9
- module AutoValues
10
- extend ::ActiveSupport::Concern
11
-
12
- included do
13
- %w[Access Admin Data Database Filesystem Mailer Ruby Source System Web]
14
- .each do |class_name|
15
- include const_get(class_name)
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_docker/executables'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'avm/docker/container'
6
-
7
- module Avm
8
- module Instances
9
- class Base
10
- module Dockerizable
11
- enable_simple_cache
12
- attr_reader :docker_image_options
13
-
14
- def docker_image_options=(options)
15
- @docker_image_options = ::ActiveSupport::HashWithIndifferentAccess.new(options)
16
- reset_cache
17
- end
18
-
19
- def docker_container_exist?
20
- ::EacDocker::Executables.docker.command.append(
21
- ['ps', '-qaf', "name=#{docker_container_name}"]
22
- ).execute!.present?
23
- end
24
-
25
- def docker_container_name
26
- id
27
- end
28
-
29
- private
30
-
31
- def docker_container_uncached
32
- ::Avm::Docker::Container.new(self)
33
- end
34
-
35
- def docker_image_uncached
36
- r = docker_image_class.new(docker_image_options.fetch(:registry))
37
- r.instance = self if r.respond_to?(:instance)
38
- r.version = docker_image_options[:version] if docker_image_options.key?(:version)
39
- r.snapshot = docker_image_options[:snapshot] if docker_image_options.key?(:snapshot)
40
- r
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,22 +0,0 @@
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
- method_name = key.to_s.variableize
11
- define_method method_name do
12
- read_entry(key)
13
- end
14
-
15
- define_method "#{method_name}_optional" do
16
- read_entry(key, required: false)
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/require_sub'
4
- require 'eac_ruby_utils/simple_cache'
5
- require 'avm/instances/entries'
6
-
7
- module Avm
8
- module Instances
9
- class Base
10
- enable_listable
11
- enable_simple_cache
12
- require_sub __FILE__, include_modules: true
13
- include ::Avm::Instances::Entries
14
-
15
- lists.add_string :access, :local, :ssh
16
-
17
- ID_PATTERN = /\A([a-z0-9]+(?:\-[a-z0-9]+)*)_(.+)\z/.freeze
18
-
19
- class << self
20
- def by_id(id)
21
- application_id, suffix = parse_id(id)
22
- require 'avm/instances/application'
23
- new(::Avm::Instances::Application.new(application_id), suffix)
24
- end
25
-
26
- private
27
-
28
- def parse_id(id)
29
- m = ID_PATTERN.match(id)
30
- return [m[1], m[2]] if m
31
-
32
- raise "ID Pattern no matched: \"#{id}\""
33
- end
34
- end
35
-
36
- common_constructor :application, :suffix do
37
- self.suffix = suffix.to_s
38
- end
39
-
40
- def id
41
- "#{application.id}_#{suffix}"
42
- end
43
-
44
- def to_s
45
- id
46
- end
47
-
48
- def host_env_uncached
49
- access = read_entry(:access, list: ::Avm::Instances::Base.lists.access.values)
50
- case access
51
- when 'local' then ::EacRubyUtils::Envs.local
52
- when 'ssh' then ::EacRubyUtils::Envs.ssh(read_entry('ssh.url'))
53
- else raise("Unmapped access value: \"#{access}\"")
54
- end
55
- end
56
-
57
- private
58
-
59
- def source_instance_uncached
60
- ::Avm::Instances::Base.by_id(source_instance_id)
61
- end
62
- end
63
- end
64
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/docker/image'
4
-
5
- module Avm
6
- module Instances
7
- class DockerImage < ::Avm::Docker::Image
8
- attr_accessor :instance
9
-
10
- def stereotype_tag
11
- instance.id
12
- end
13
- end
14
- end
15
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/instances/entry'
5
-
6
- module Avm
7
- module Instances
8
- module Entries
9
- def entry(suffix, options = {})
10
- ::Avm::Instances::Entry.new(self, suffix, options)
11
- end
12
-
13
- def path_prefix
14
- @path_prefix ||= [id].freeze
15
- end
16
-
17
- def read_entry(entry_suffix, options = {})
18
- entry(entry_suffix, options).value
19
- end
20
-
21
- def read_entry_optional(entry_suffix, options = {})
22
- entry(entry_suffix, options).optional_value
23
- end
24
-
25
- def full_entry_path(entry_suffix)
26
- unless entry_suffix.is_a?(::Array)
27
- entry_suffix = ::EacConfig::PathsHash.parse_entry_key(entry_suffix.to_s)
28
- end
29
- (path_prefix + entry_suffix).join('.')
30
- end
31
-
32
- def inherited_entry_value(source_entry_suffix, target_entry_suffix, &block)
33
- read_entry_optional(source_entry_suffix).if_present do |instance_id|
34
- other_entry_value(instance_id, target_entry_suffix).if_present(&block)
35
- end
36
- end
37
-
38
- def other_entry_value(instance_id, entry_suffix)
39
- ::Avm::Instances::Base.by_id(instance_id).read_entry_optional(entry_suffix)
40
- end
41
- end
42
- end
43
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_config/node'
4
- require 'eac_ruby_utils/core_ext'
5
-
6
- module Avm
7
- module Instances
8
- class Entry
9
- class << self
10
- def auto_value_method_name(suffix)
11
- "auto_#{suffix.to_s.gsub('.', '_')}"
12
- end
13
- end
14
-
15
- common_constructor :parent, :suffix, :options
16
-
17
- def auto_value
18
- parent.respond_to?(auto_value_method, true) ? parent.send(auto_value_method) : nil
19
- end
20
-
21
- def auto_value_method
22
- self.class.auto_value_method_name(suffix)
23
- end
24
-
25
- def full_path
26
- (parent.path_prefix + suffix_as_array).join('.')
27
- end
28
-
29
- def optional_value
30
- context_entry.found? ? context_entry.value : auto_value
31
- end
32
-
33
- def read
34
- context_entry.value
35
- end
36
-
37
- def suffix_as_array
38
- if suffix.is_a?(::Array)
39
- suffix.dup
40
- else
41
- ::EacConfig::PathsHash.parse_entry_key(suffix.to_s)
42
- end
43
- end
44
-
45
- def value
46
- optional_value || read
47
- end
48
-
49
- def write(value)
50
- context_entry.value = value
51
- end
52
-
53
- private
54
-
55
- def context_entry
56
- ::EacConfig::Node.context.current.entry(full_path)
57
- end
58
- end
59
- end
60
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Instances
7
- module EntryKeys
8
- class << self
9
- def all
10
- all_keys.to_a
11
- end
12
-
13
- def keys_consts_set(prefix, suffixes)
14
- if suffixes.is_a?(::Hash)
15
- keys_consts_set_from_hash(prefix, suffixes)
16
- elsif suffixes.is_a?(::Enumerable)
17
- keys_consts_set_from_enum(prefix, suffixes)
18
- else
19
- raise "Unmapped suffixes class: #{suffixes.class}"
20
- end
21
- end
22
-
23
- def key_const_set(prefix, suffix)
24
- key = [prefix, suffix].reject(&:blank?).join('.')
25
- const_set(key.gsub('.', '_').upcase, key)
26
- all_keys << key
27
- end
28
-
29
- private
30
-
31
- def all_keys
32
- @all_keys ||= ::Set.new
33
- end
34
-
35
- def keys_consts_set_from_enum(prefix, suffixes)
36
- suffixes.each { |suffix| key_const_set(prefix, suffix) }
37
- end
38
-
39
- def keys_consts_set_from_hash(prefix, suffixes)
40
- suffixes.each { |k, v| keys_consts_set(prefix.to_s + (k.blank? ? '' : ".#{k}"), v) }
41
- end
42
- end
43
-
44
- {
45
- '' => %w[data_fs_path fs_path host_id name source_instance_id],
46
- admin: %w[username password api_key],
47
- database: %w[id hostname limit name password port system timeout username extra],
48
- docker: %w[registry],
49
- fs: %w[url],
50
- mailer: {
51
- '' => %w[id from reply_to],
52
- smtp: %w[address port domain username password authentication openssl_verify_mode
53
- starttls_auto tls]
54
- },
55
- ssh: %w[hostname port url username],
56
- web: %w[authority hostname path port scheme url userinfo]
57
- }.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
58
- end
59
- end
60
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/runners/base'
4
- require 'eac_cli/core_ext'
5
-
6
- module Avm
7
- module Instances
8
- class Runner < ::Avm::Runners::Base
9
- class << self
10
- def instance_class
11
- ::Avm.const_get(stereotype_name).const_get('Instance')
12
- end
13
-
14
- def stereotype_module
15
- ::Avm.const_get(stereotype_name)
16
- end
17
-
18
- def stereotype_name
19
- name.demodulize
20
- end
21
- end
22
-
23
- description = "Utilities for #{stereotype_name} instances."
24
- runner_with :help, :subcommands do
25
- desc description
26
- pos_arg 'instance-id'
27
- subcommands
28
- end
29
-
30
- delegate :instance_class, :stereotype_module, :stereotype_name, to: :class
31
-
32
- private
33
-
34
- def instance_uncached
35
- self.class.instance_class.by_id(parsed.instance_id)
36
- end
37
- end
38
- end
39
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Instances
5
- require 'avm/instances/application'
6
- require 'avm/instances/entries'
7
- end
8
- end
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/jobs/variables_source'
4
- require 'avm/result'
5
- require 'eac_cli/core_ext'
6
-
7
- module Avm
8
- module Jobs
9
- module Base
10
- common_concern do
11
- include ::ActiveSupport::Callbacks
12
-
13
- enable_speaker
14
- enable_simple_cache
15
- enable_listable
16
- common_constructor :instance, :options, default: [{}] do
17
- if option_list.present?
18
- self.options = option_list.hash_keys_validate!(options.symbolize_keys)
19
- end
20
- end
21
- define_callbacks(*jobs)
22
- end
23
-
24
- module ClassMethods
25
- def jobs
26
- const_get('JOBS').dup
27
- end
28
- end
29
-
30
- module InstanceMethods
31
- def option_list
32
- nil
33
- end
34
-
35
- def run
36
- start_banner if respond_to?(:start_banner)
37
- run_jobs
38
- ::Avm::Result.success('Done!')
39
- rescue ::Avm::Result::Error => e
40
- e.to_result
41
- end
42
-
43
- def variables_source
44
- ::Avm::Jobs::VariablesSource.new(self, instance)
45
- end
46
-
47
- protected
48
-
49
- def run_jobs
50
- jobs.each do |job|
51
- run_callbacks job do
52
- send(job)
53
- end
54
- end
55
- end
56
-
57
- def jobs
58
- self.class.jobs
59
- end
60
- end
61
- end
62
- end
63
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Jobs
7
- class VariablesSource
8
- common_constructor :job, :instance
9
-
10
- def read_entry(path, options = {})
11
- entry_from_job(path) || instance.read_entry(path, options)
12
- end
13
-
14
- private
15
-
16
- def entry_from_job(path)
17
- method = path.gsub('.', '_').underscore
18
- return job.send(method) if job.respond_to?(method, true)
19
- end
20
- end
21
- end
22
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Jobs
7
- require_sub __FILE__
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module Launcher
5
- module Errors
6
- class Base < ::StandardError
7
- end
8
- end
9
- end
10
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/launcher/errors/base'
4
-
5
- module Avm
6
- module Launcher
7
- module Errors
8
- class NonProject < ::Avm::Launcher::Errors::Base
9
- def initialize(path)
10
- super("#{path} is not a project")
11
- end
12
- end
13
- end
14
- end
15
- end