eac_tools 0.103.0 → 0.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +22 -27
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +1 -1
  5. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +0 -2
  6. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +0 -3
  7. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +0 -4
  8. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +0 -3
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +0 -3
  10. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/nodejs.rb +0 -3
  11. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +0 -3
  12. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +1 -7
  13. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +0 -3
  14. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +0 -6
  15. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/entity_base.rb +0 -4
  16. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/project.rb +0 -5
  17. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/root.rb +0 -4
  18. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/wiki_page.rb +0 -4
  19. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb +0 -4
  20. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb +0 -2
  21. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/read.rb +0 -2
  22. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/write.rb +0 -2
  23. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page.rb +0 -4
  24. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project.rb +0 -4
  25. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +0 -3
  26. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +0 -4
  27. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/core_update.rb +0 -6
  28. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +0 -4
  29. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +0 -3
  30. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  31. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +1 -0
  32. data/sub/eac_cli/eac_cli.gemspec +23 -0
  33. data/sub/eac_cli/lib/eac_cli/config/entry/options.rb +55 -0
  34. data/sub/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
  35. data/sub/eac_cli/lib/eac_cli/config/entry.rb +55 -0
  36. data/sub/eac_cli/lib/eac_cli/config.rb +15 -0
  37. data/sub/eac_cli/lib/eac_cli/core_ext.rb +4 -0
  38. data/sub/eac_cli/lib/eac_cli/default_runner.rb +12 -0
  39. data/sub/eac_cli/lib/eac_cli/definition/alternative.rb +101 -0
  40. data/sub/eac_cli/lib/eac_cli/definition/argument_option.rb +19 -0
  41. data/sub/eac_cli/lib/eac_cli/definition/boolean_option.rb +25 -0
  42. data/sub/eac_cli/lib/eac_cli/definition/error.rb +8 -0
  43. data/sub/eac_cli/lib/eac_cli/definition/option/initialize_args_parser.rb +48 -0
  44. data/sub/eac_cli/lib/eac_cli/definition/option.rb +70 -0
  45. data/sub/eac_cli/lib/eac_cli/definition/option_or_positional.rb +41 -0
  46. data/sub/eac_cli/lib/eac_cli/definition/positional.rb +50 -0
  47. data/sub/eac_cli/lib/eac_cli/definition.rb +104 -0
  48. data/sub/eac_cli/lib/eac_cli/enum.rb +42 -0
  49. data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +76 -0
  50. data/sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +14 -0
  51. data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +42 -0
  52. data/sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +23 -0
  53. data/sub/eac_cli/lib/eac_cli/old_configs.rb +31 -0
  54. data/sub/eac_cli/lib/eac_cli/parser/alternative/any_options.rb +17 -0
  55. data/sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb +19 -0
  56. data/sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
  57. data/sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
  58. data/sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
  59. data/sub/eac_cli/lib/eac_cli/parser/alternative/options.rb +29 -0
  60. data/sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
  61. data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +54 -0
  62. data/sub/eac_cli/lib/eac_cli/parser/alternative.rb +99 -0
  63. data/sub/eac_cli/lib/eac_cli/parser/collector.rb +52 -0
  64. data/sub/eac_cli/lib/eac_cli/parser/error.rb +13 -0
  65. data/sub/eac_cli/lib/eac_cli/parser.rb +32 -0
  66. data/sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb +22 -0
  67. data/sub/eac_cli/lib/eac_cli/patches/object.rb +5 -0
  68. data/sub/eac_cli/lib/eac_cli/patches.rb +3 -0
  69. data/sub/eac_cli/lib/eac_cli/rspec/setup.rb +41 -0
  70. data/sub/eac_cli/lib/eac_cli/rspec.rb +7 -0
  71. data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +34 -0
  72. data/sub/eac_cli/lib/eac_cli/runner/class_runner.rb +32 -0
  73. data/sub/eac_cli/lib/eac_cli/runner/context.rb +57 -0
  74. data/sub/eac_cli/lib/eac_cli/runner/context_responders/base.rb +22 -0
  75. data/sub/eac_cli/lib/eac_cli/runner/context_responders/parent.rb +24 -0
  76. data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner.rb +17 -0
  77. data/sub/eac_cli/lib/eac_cli/runner/context_responders/runner_missing_method.rb +29 -0
  78. data/sub/eac_cli/lib/eac_cli/runner/context_responders/set.rb +41 -0
  79. data/sub/eac_cli/lib/eac_cli/runner/context_responders.rb +9 -0
  80. data/sub/eac_cli/lib/eac_cli/runner/exit.rb +14 -0
  81. data/sub/eac_cli/lib/eac_cli/runner/for_context.rb +35 -0
  82. data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +45 -0
  83. data/sub/eac_cli/lib/eac_cli/runner.rb +47 -0
  84. data/sub/eac_cli/lib/eac_cli/runner_with/confirmation/input_result.rb +60 -0
  85. data/sub/eac_cli/lib/eac_cli/runner_with/confirmation.rb +65 -0
  86. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +61 -0
  87. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +79 -0
  88. data/sub/eac_cli/lib/eac_cli/runner_with/help/layout.rb +38 -0
  89. data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +51 -0
  90. data/sub/eac_cli/lib/eac_cli/runner_with/input.rb +32 -0
  91. data/sub/eac_cli/lib/eac_cli/runner_with/output.rb +54 -0
  92. data/sub/eac_cli/lib/eac_cli/runner_with/output_item/asciidoc_formatter.rb +70 -0
  93. data/sub/eac_cli/lib/eac_cli/runner_with/output_item/base_formatter.rb +12 -0
  94. data/sub/eac_cli/lib/eac_cli/runner_with/output_item/csv_formatter.rb +21 -0
  95. data/sub/eac_cli/lib/eac_cli/runner_with/output_item/yaml_formatter.rb +16 -0
  96. data/sub/eac_cli/lib/eac_cli/runner_with/output_item.rb +47 -0
  97. data/sub/eac_cli/lib/eac_cli/runner_with/output_list/base_formatter.rb +44 -0
  98. data/sub/eac_cli/lib/eac_cli/runner_with/output_list/csv_formatter.rb +24 -0
  99. data/sub/eac_cli/lib/eac_cli/runner_with/output_list/tty_formatter.rb +34 -0
  100. data/sub/eac_cli/lib/eac_cli/runner_with/output_list/yaml_formatter.rb +21 -0
  101. data/sub/eac_cli/lib/eac_cli/runner_with/output_list.rb +39 -0
  102. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
  103. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +124 -0
  104. data/sub/eac_cli/lib/eac_cli/runner_with.rb +7 -0
  105. data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +54 -0
  106. data/sub/eac_cli/lib/eac_cli/speaker/constants.rb +11 -0
  107. data/sub/eac_cli/lib/eac_cli/speaker/input_blocked.rb +14 -0
  108. data/sub/eac_cli/lib/eac_cli/speaker/input_requested.rb +8 -0
  109. data/sub/eac_cli/lib/eac_cli/speaker/list.rb +84 -0
  110. data/sub/eac_cli/lib/eac_cli/speaker/options.rb +42 -0
  111. data/sub/eac_cli/lib/eac_cli/speaker/request_from_list.rb +40 -0
  112. data/sub/eac_cli/lib/eac_cli/speaker.rb +114 -0
  113. data/sub/eac_cli/lib/eac_cli/version.rb +5 -0
  114. data/sub/eac_cli/lib/eac_cli.rb +14 -0
  115. data/sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +18 -0
  116. data/sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb +14 -0
  117. data/sub/eac_cli/spec/lib/eac_cli/parser/alternative/subcommands_spec.rb +58 -0
  118. data/sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +89 -0
  119. data/sub/eac_cli/spec/lib/eac_cli/runner/for_context_spec.rb +79 -0
  120. data/sub/eac_cli/spec/lib/eac_cli/runner_spec.rb +129 -0
  121. data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation/input_result_spec.rb +36 -0
  122. data/sub/eac_cli/spec/lib/eac_cli/runner_with/confirmation_spec.rb +42 -0
  123. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help/layout_spec.rb +21 -0
  124. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +51 -0
  125. data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_list_spec.rb +57 -0
  126. data/sub/eac_cli/spec/lib/eac_cli/runner_with/output_spec.rb +81 -0
  127. data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +99 -0
  128. data/sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb +36 -0
  129. data/sub/{eac_docker → eac_cli}/spec/spec_helper.rb +1 -2
  130. metadata +108 -48
  131. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb +0 -14
  132. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb +0 -11
  133. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners.rb +0 -13
  134. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb +0 -11
  135. data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +0 -21
  136. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +0 -57
  137. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +0 -24
  138. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +0 -31
  139. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +0 -24
  140. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +0 -82
  141. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +0 -15
  142. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +0 -26
  143. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +0 -7
  144. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb +0 -13
  145. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +0 -12
  146. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server_spec.rb +0 -11
  147. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb +0 -11
  148. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +0 -5
  149. data/sub/avm-eac_ubuntu_base0/spec/spec_helper.rb +0 -5
  150. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +0 -27
  151. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile.template +0 -24
  152. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa +0 -27
  153. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub +0 -1
  154. data/sub/eac_docker/Gemfile +0 -8
  155. data/sub/eac_docker/eac_docker.gemspec +0 -20
  156. data/sub/eac_docker/lib/eac_docker/container.rb +0 -83
  157. data/sub/eac_docker/lib/eac_docker/debug.rb +0 -13
  158. data/sub/eac_docker/lib/eac_docker/executables.rb +0 -15
  159. data/sub/eac_docker/lib/eac_docker/images/base.rb +0 -11
  160. data/sub/eac_docker/lib/eac_docker/images/coded.rb +0 -39
  161. data/sub/eac_docker/lib/eac_docker/images/named.rb +0 -26
  162. data/sub/eac_docker/lib/eac_docker/images/templatized.rb +0 -43
  163. data/sub/eac_docker/lib/eac_docker/registry.rb +0 -15
  164. data/sub/eac_docker/lib/eac_docker/rspec/setup.rb +0 -15
  165. data/sub/eac_docker/lib/eac_docker/rspec/stub_image.rb +0 -39
  166. data/sub/eac_docker/lib/eac_docker/version.rb +0 -5
  167. data/sub/eac_docker/lib/eac_docker.rb +0 -9
  168. data/sub/eac_docker/spec/lib/eac_docker/executables_spec.rb +0 -7
  169. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +0 -10
  170. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +0 -1
  171. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +0 -15
  172. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +0 -1
  173. data/sub/eac_docker/spec/rubocop_spec.rb +0 -3
  174. /data/sub/{avm-eac_ubuntu_base0 → eac_cli}/Gemfile +0 -0
  175. /data/sub/{avm-eac_ubuntu_base0 → eac_cli}/spec/rubocop_spec.rb +0 -0
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRedmineBase0
7
- module Instances
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRedmineBase0
7
- module Sources
8
- module Runners
9
- require_sub __FILE__
10
- end
11
- end
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module EacRedmineBase0
7
- module Sources
8
- require_sub __FILE__
9
- end
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- require 'avm/eac_ubuntu_base0/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'avm-eac_ubuntu_base0'
9
- s.version = Avm::EacUbuntuBase0::VERSION
10
- s.authors = ['Put here the authors']
11
- s.summary = 'Put here de description.'
12
-
13
- s.files = Dir['{lib,template}/**/*']
14
- s.required_ruby_version = '>= 2.7'
15
-
16
- s.add_dependency 'avm', '~> 0.97'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.128', '>= 0.128.3'
18
- s.add_dependency 'eac_templates', '~> 0.8', '>= 0.8.1'
19
-
20
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.12'
21
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- class Apache
6
- class Resource
7
- common_constructor :apache, :type, :directory_prefix, :name
8
-
9
- def available_path
10
- ::File.join(apache.etc_root, "#{directory_prefix}-available", "#{name}.conf")
11
- end
12
-
13
- def available?
14
- apache.host_env.file(available_path).exist?
15
- end
16
-
17
- def disable
18
- apache.host_env.command('sudo', "a2dis#{type}", name).execute!
19
- end
20
-
21
- def enable
22
- apache.host_env.command('sudo', "a2en#{type}", name).execute!
23
- end
24
-
25
- def enabled_path
26
- ::File.join(apache.etc_root, "#{directory_prefix}-enabled", "#{name}.conf")
27
- end
28
-
29
- def enabled?
30
- apache.host_env.file(enabled_path).exist?
31
- end
32
-
33
- def remove
34
- remove_disabled
35
- remove_available
36
- end
37
-
38
- def remove_available
39
- raise 'Remove enabled before' if enabled?
40
-
41
- apache.host_env.command('sudo', 'rm', '-f', available_path).execute! if available?
42
- end
43
-
44
- def remove_disabled
45
- disable if enabled?
46
- apache.host_env.command('sudo', 'rm', '-f', enabled_path).execute! if enabled?
47
- end
48
-
49
- def write(content)
50
- ::EacRubyUtils::Envs.local.command('echo', content).pipe(
51
- apache.host_env.command('sudo', 'tee', available_path)
52
- ).execute!
53
- end
54
- end
55
- end
56
- end
57
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- class Apache
6
- require_sub __FILE__
7
- common_constructor :host_env
8
-
9
- def etc_root
10
- '/etc/apache2'
11
- end
12
-
13
- def service(command)
14
- host_env.command('sudo', 'service', 'apache2', command)
15
- end
16
-
17
- { conf: :conf, site: :sites }.each do |type, directory_prefix|
18
- define_method type do |name|
19
- ::Avm::EacUbuntuBase0::Apache::Resource.new(self, type, directory_prefix, name)
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- class DockerImage < ::Avm::Docker::Image
6
- BASE_IMAGE = 'ubuntu:24.04'
7
- USER_NAME = 'myuser'
8
-
9
- # @return [String]
10
- def base_image
11
- BASE_IMAGE
12
- end
13
-
14
- def stereotype_tag
15
- 'eac_ubuntu_base0'
16
- end
17
-
18
- def user_home
19
- ::File.join('/home', user_name)
20
- end
21
-
22
- def user_name
23
- USER_NAME
24
- end
25
-
26
- def user_password
27
- user_name
28
- end
29
- end
30
- end
31
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- module Instances
6
- class Base < ::Avm::Instances::Base
7
- # @return [Avm::EacUbuntuBase0::Apache]
8
- def apache
9
- ::Avm::EacUbuntuBase0::Apache.new(host_env)
10
- end
11
-
12
- def docker_image_class
13
- ::Avm::EacUbuntuBase0::DockerImage
14
- end
15
-
16
- def file_sudo_write(path, content)
17
- ::EacRubyUtils::Envs.local.command('echo', content).pipe(
18
- host_env.command('sudo', 'tee', path)
19
- ).execute!
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,82 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- module Rspec
6
- class SshDockerServer < ::EacDocker::Images::Templatized
7
- def base_image
8
- ::Avm::EacUbuntuBase0::DockerImage::BASE_IMAGE
9
- end
10
-
11
- # @return [EacRubyUtils::Envs::SshEnv]
12
- def env
13
- raise '@env is blank' if @env.blank?
14
-
15
- @env
16
- end
17
-
18
- def on_run(&block)
19
- on_container do
20
- on_env(&block)
21
- end
22
- end
23
-
24
- private
25
-
26
- def container
27
- raise '@container is blank' if @container.blank?
28
-
29
- @container
30
- end
31
-
32
- def env_identity_file
33
- template.child('id_rsa').path
34
- end
35
-
36
- def env_identity_file_good_permissions
37
- r = ::EacRubyUtils::Fs::Temp.file
38
- ::FileUtils.cp env_identity_file, r
39
- r.chmod(0o600)
40
- r
41
- end
42
-
43
- def close_env
44
- @identity_file.remove
45
- @env = nil
46
- end
47
-
48
- def on_env
49
- open_env
50
- begin
51
- yield
52
- ensure
53
- close_env
54
- end
55
- end
56
-
57
- def on_container
58
- provide.container.temporary(true).on_detached do |container|
59
- @container = container
60
- begin
61
- yield
62
- ensure
63
- @container = nil
64
- end
65
- end
66
- end
67
-
68
- def open_env
69
- raise 'Environment already open' if @env.present?
70
-
71
- @identity_file = env_identity_file_good_permissions
72
- @env = ::EacRubyUtils::Envs::SshEnv.new(
73
- "ssh://root@#{container.hostname}" \
74
- '?StrictHostKeyChecking=no' \
75
- '&BatchMode=yes' \
76
- "&IdentityFile=#{@identity_file}"
77
- )
78
- end
79
- end
80
- end
81
- end
82
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- module Runners
6
- class Base < ::Avm::Runners::Base
7
- class Docker < ::Avm::Docker::Runner
8
- def use_default_registry?
9
- true
10
- end
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- module Runners
6
- class Base < ::Avm::Runners::Base
7
- enable_simple_cache
8
- require_sub __FILE__
9
-
10
- INSTANCE_ID = 'eac-ubuntu-base0_self'
11
-
12
- runner_with :help, :subcommands do
13
- subcommands
14
- end
15
-
16
- for_context :instance
17
-
18
- private
19
-
20
- def instance_uncached
21
- ::Avm::EacUbuntuBase0::Instances::Base.by_id(INSTANCE_ID)
22
- end
23
- end
24
- end
25
- end
26
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Avm
4
- module EacUbuntuBase0
5
- VERSION = '0.6.0'
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils'
4
- EacRubyUtils::RootModuleSetup.perform __FILE__
5
-
6
- module Avm
7
- module EacUbuntuBase0
8
- end
9
- end
10
-
11
- require 'avm'
12
- require 'eac_docker'
13
- require 'eac_templates'
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Avm::EacUbuntuBase0::DockerImage do
4
- let(:registry) { EacDocker::Registry.new('stub') }
5
- let(:instance) { described_class.new(registry) }
6
-
7
- describe '#provide' do
8
- it do
9
- expect(instance.provide).to be_a(EacDocker::Images::Base)
10
- end
11
- end
12
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Avm::EacUbuntuBase0::Rspec::SshDockerServer do
4
- let(:instance) { described_class.new }
5
-
6
- describe '#provide' do
7
- it do
8
- expect(instance.provide).to be_a(EacDocker::Images::Base)
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Avm::EacUbuntuBase0::Runners::Base::Docker do
4
- it do
5
- expect { run_command('--registry-name', 'testing', '--image-name') }.not_to raise_error
6
- end
7
-
8
- def run_command(*argv)
9
- Avm::EacUbuntuBase0::Runners::Base.run(argv: %w[docker] + argv)
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Avm::EacUbuntuBase0::Runners::Base do
4
- include_examples 'in_avm_registry', 'runners'
5
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_ubuntu_base0'
4
- require 'eac_ruby_gem_support'
5
- EacRubyUtils::Rspec.default_setup_create(File.expand_path('..', __dir__)).stub_avm_contexts
@@ -1,27 +0,0 @@
1
- FROM %%base_image%%
2
-
3
- # Base system update
4
- ENV DEBIAN_FRONTEND=noninteractive
5
- RUN apt-get update -y
6
- RUN apt-get dist-upgrade -y
7
-
8
- # Timezone
9
- RUN apt-get install -y tzdata
10
- RUN ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
11
- RUN dpkg-reconfigure --frontend noninteractive tzdata
12
-
13
- # Default user
14
- RUN /usr/sbin/groupmod --new-name '%%user_name%%' ubuntu
15
- RUN /usr/sbin/usermod --shell /bin/bash --home %%user_home%% --move-home --login %%user_name%% \
16
- ubuntu
17
- RUN /bin/echo '%%user_name%%:%%user_password%%' | /usr/sbin/chpasswd
18
- RUN /bin/chown %%user_name%%:%%user_name%% %%user_home%% -R
19
-
20
- # Sudo
21
- RUN apt-get install -y sudo
22
- RUN /bin/echo "%%user_name%% ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/%%user_name%%_all_nopasswd && chmod 0440 /etc/sudoers.d/%%user_name%%_all_nopasswd
23
-
24
- # Container
25
- USER %%user_name%%
26
- WORKDIR %%user_home%%
27
- CMD /bin/bash
@@ -1,24 +0,0 @@
1
- FROM '%%base_image%%'
2
- MAINTAINER Aleksandar Diklic "https://github.com/rastasheep"
3
-
4
- RUN apt-get update
5
-
6
- RUN apt-get install -y openssh-server
7
- RUN mkdir /var/run/sshd
8
-
9
- RUN echo 'root:root' |chpasswd
10
-
11
- RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
12
- RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
13
-
14
- RUN mkdir -p /root/.ssh
15
- ADD id_rsa /root/.ssh/id_rsa
16
- ADD id_rsa.pub /root/.ssh/id_rsa.pub
17
- ADD id_rsa.pub /root/.ssh/authorized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hPTsXVbq7j+98adnfOPJfADR5/XBnjpGDMWBVMFk6el/QQuNxbRVF++AZHK2hjbam+rG1hzli6aB12naiLd9QoyhGsMDBTv5UUpRC/ReYyxkoqnaJ6KGX9ZEj1JxezXpA1BmpWqfD2WXZpRo9VV/UmTh avm@localhost
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
8
- eval_gemfile local_gemfile if File.exist?(local_gemfile)
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- require 'eac_docker/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'eac_docker'
9
- s.version = EacDocker::VERSION
10
- s.authors = ['Put here the authors']
11
- s.summary = 'Put here de description.'
12
-
13
- s.files = Dir['{lib}/**/*']
14
- s.required_ruby_version = '>= 2.7'
15
-
16
- s.add_dependency 'eac_ruby_utils', '~> 0.128', '>= 0.128.2'
17
- s.add_dependency 'eac_templates', '~> 0.8', '>= 0.8.1'
18
-
19
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.12'
20
- end
@@ -1,83 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacDocker
4
- class Container
5
- enable_immutable
6
- immutable_accessor :interactive, :temporary, :tty, type: :boolean
7
- immutable_accessor :env, type: :hash
8
- immutable_accessor :capability, :command_arg, :volume, type: :array
9
- attr_reader :id
10
-
11
- common_constructor :image
12
-
13
- def immutable_constructor_args
14
- [image]
15
- end
16
-
17
- alias immutable_volume volume
18
-
19
- def hostname
20
- ::EacDocker::Executables.docker.command(
21
- 'inspect', '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}',
22
- id
23
- ).execute!.strip
24
- end
25
-
26
- # @return [String]
27
- def logs
28
- ::EacDocker::Executables.docker.command('logs', id).execute!
29
- end
30
-
31
- def on_detached
32
- command = ::EacDocker::Executables.docker.command(*(%w[run --detach] + run_command_args))
33
- self.id = command.execute!.strip
34
- begin
35
- yield(self)
36
- ensure
37
- stop
38
- end
39
- end
40
-
41
- def volume(left_part, right_part = nil)
42
- immutable_volume(right_part.if_present(left_part) { |v| "#{left_part}:#{v}" })
43
- end
44
-
45
- def run_command
46
- ::EacDocker::Executables.docker.command('run', *run_command_args)
47
- end
48
-
49
- def run_command_args
50
- %w[boolean capabilities envs volumes]
51
- .inject([]) { |a, e| a + send("run_command_#{e}_args") } +
52
- [image.provide.id] + command_args
53
- end
54
-
55
- def stop
56
- ::EacDocker::Executables.docker.command('stop', id).execute!
57
- end
58
-
59
- private
60
-
61
- attr_writer :id
62
-
63
- def run_command_boolean_args
64
- r = []
65
- r << '--interactive' if interactive?
66
- r << '--tty' if tty?
67
- r << '--rm' if temporary?
68
- r
69
- end
70
-
71
- def run_command_capabilities_args
72
- capabilities.flat_map { |capability| ['--cap-add', capability] }
73
- end
74
-
75
- def run_command_volumes_args
76
- volumes.flat_map { |volume| ['--volume', volume] }
77
- end
78
-
79
- def run_command_envs_args
80
- envs.flat_map { |name, value| ['--env', "#{name}=#{value}"] }
81
- end
82
- end
83
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacDocker
4
- module Debug
5
- class << self
6
- ENABLE_ENVVAR = 'EAC_DOCKER_DEBUG'
7
-
8
- def enabled?
9
- ::EacRubyUtils::Boolean.parse(ENV.fetch(ENABLE_ENVVAR, nil))
10
- end
11
- end
12
- end
13
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacDocker
4
- module Executables
5
- class << self
6
- def env
7
- ::EacRubyUtils::Envs.local
8
- end
9
-
10
- def docker
11
- @docker ||= env.executable('docker', '--version')
12
- end
13
- end
14
- end
15
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacDocker
4
- module Images
5
- class Base
6
- def container
7
- ::EacDocker::Container.new(self)
8
- end
9
- end
10
- end
11
- end