eac_tools 0.31.1 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +36 -36
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/avm.gemspec +1 -1
  5. data/sub/avm/lib/avm/entries/auto_values/entry.rb +11 -4
  6. data/sub/avm/lib/avm/entries/jobs/base.rb +62 -0
  7. data/sub/avm/lib/avm/entries/jobs/variables_source/read_entry.rb +50 -0
  8. data/sub/avm/lib/avm/entries/jobs/variables_source.rb +15 -0
  9. data/sub/avm/lib/avm/entries/jobs/with_variables_source.rb +15 -0
  10. data/sub/avm/lib/avm/{jobs.rb → entries/jobs.rb} +4 -2
  11. data/sub/avm/lib/avm/instances/base/entry_keys.rb +1 -1
  12. data/sub/avm/lib/avm/instances/entry_keys.rb +1 -1
  13. data/sub/avm/lib/avm/rspec/setup.rb +7 -8
  14. data/sub/avm/lib/avm/rspec/shared_examples/entries_values.rb +23 -0
  15. data/sub/avm/lib/avm/version.rb +1 -1
  16. data/sub/avm/spec/lib/avm/instances/base_spec.rb +77 -97
  17. data/sub/avm/spec/lib/avm/instances/{base_spec_configs_storage.yml → base_spec_files/config.yml} +0 -0
  18. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +2 -2
  19. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/apache_host.rb +2 -2
  20. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/apache_path.rb +2 -2
  21. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/deploy.rb +2 -2
  22. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  23. data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
  24. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/apache_host.rb +2 -2
  25. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/deploy.rb +2 -2
  26. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
  27. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
  28. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/apache_host.rb +2 -2
  29. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/apache_path.rb +2 -2
  30. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/deploy.rb +2 -2
  31. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  32. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
  33. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_host.rb +19 -0
  34. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/service.rb +72 -0
  35. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit/tasks_scheduler_command.rb +31 -0
  36. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/systemd_unit.rb +59 -0
  37. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +4 -4
  38. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  39. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/{systemd_unit → instances/systemd_unit}/tasks_scheduler.service +0 -0
  40. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/{systemd_unit → instances/systemd_unit}/tasks_scheduler_command.sh +0 -0
  41. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
  42. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +2 -2
  43. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +30 -0
  44. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +42 -0
  45. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +20 -0
  46. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +1 -0
  47. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +2 -2
  48. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +2 -6
  49. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  50. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec.rb +26 -0
  51. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec_files/config.yml +10 -0
  52. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +11 -3
  53. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
  54. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_host.rb +85 -0
  55. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_path.rb +54 -0
  56. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +1 -1
  57. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/appended_directories.rb +27 -0
  58. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/build.rb +50 -0
  59. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb +44 -0
  60. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/git_info.rb +64 -0
  61. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/version.rb +26 -0
  62. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/write_on_target.rb +20 -0
  63. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb +75 -0
  64. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  65. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/{apache_host → instances/apache_host}/no_ssl.conf +0 -0
  66. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/{apache_path → instances/apache_path}/default.conf +0 -0
  67. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
  68. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/apache_host.rb +2 -2
  69. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/deploy.rb +2 -2
  70. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
  71. metadata +63 -31
  72. data/sub/avm/lib/avm/jobs/base.rb +0 -63
  73. data/sub/avm/lib/avm/jobs/variables_source.rb +0 -22
  74. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +0 -17
  75. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +0 -70
  76. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +0 -29
  77. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +0 -57
  78. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +0 -83
  79. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +0 -51
  80. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +0 -25
  81. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +0 -48
  82. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +0 -42
  83. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +0 -62
  84. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +0 -24
  85. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +0 -18
  86. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 892682917367f717a0f078304525d17496c7212c3830629384e476d4ccbaa5f3
4
- data.tar.gz: 9f3e28c9c3c5a94ca9c110e0fcaac8d5e3158248bb00d27797eb1855c2cee7e3
3
+ metadata.gz: 81dc6bdf661e34dc3a4136b707733bea7f9528829dc30e9b918a656c156db423
4
+ data.tar.gz: 87651ba1f7ea344fc8d53e29f7360e65a391b4acf0c4f77456104bfbd6a6af43
5
5
  SHA512:
6
- metadata.gz: f798e7f96fcb48382de6b4a17d83ded84ddaebc54a56636453821ee588749e1abec34eb74f1bd5d78a6399464db5a7c29f14365c2672538e3fa764caac5b4b91
7
- data.tar.gz: 115edfd9cdd9b6e96bca831a1d3d984186665854422abbe24af41b653f2130b6ac1c6750b8faa6365b079f6e75065b05005b85cd7fa415417438b0d51e43cdc4
6
+ metadata.gz: 39579d9d45e8a0b0064553aec347e5d0915c8bdf9e14037af7ea5f29c3bb8f4d5622a16405095906db82e0691c1d5ca33a5a3808b5f6acfdb478775961a04003
7
+ data.tar.gz: f0b3749dcf1ebc71f2a15bb04a2a2bbbf1785655b9ce7a0cb2331ddd3d44dc9a389247e963595e0899a75fc0bd5505743e5954890ec3df0800638b193873ee78
data/Gemfile.lock CHANGED
@@ -1,28 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.31.1)
5
- avm (~> 0.44)
6
- avm-eac_asciidoctor_base0 (~> 0.7)
4
+ eac_tools (0.32.0)
5
+ avm (~> 0.45)
6
+ avm-eac_asciidoctor_base0 (~> 0.7, >= 0.7.1)
7
7
  avm-eac_generic_base0 (~> 0.5)
8
- avm-eac_latex_base0 (~> 0.2)
9
- avm-eac_rails_base0 (~> 0.8)
10
- avm-eac_rails_base1 (~> 0.6)
11
- avm-eac_redmine_base0 (~> 0.15)
8
+ avm-eac_latex_base0 (~> 0.2, >= 0.2.1)
9
+ avm-eac_rails_base0 (~> 0.8, >= 0.8.1)
10
+ avm-eac_rails_base1 (~> 0.7)
11
+ avm-eac_redmine_base0 (~> 0.16)
12
12
  avm-eac_redmine_plugin_base0 (~> 0.3)
13
13
  avm-eac_ruby_base1 (~> 0.21)
14
- avm-eac_webapp_base0 (~> 0.8)
15
- avm-eac_wordpress_base0 (~> 0.2)
14
+ avm-eac_webapp_base0 (~> 0.9)
15
+ avm-eac_wordpress_base0 (~> 0.2, >= 0.2.1)
16
16
  avm-tools (~> 0.136, >= 0.136.2)
17
17
  eac_ruby_utils (~> 0.104)
18
18
 
19
19
  PATH
20
20
  remote: sub/avm-eac_asciidoctor_base0
21
21
  specs:
22
- avm-eac_asciidoctor_base0 (0.7.0)
22
+ avm-eac_asciidoctor_base0 (0.7.1)
23
23
  asciidoctor (~> 2.0, >= 2.0.17)
24
- avm-eac_webapp_base0 (~> 0.7)
25
- eac_ruby_utils (~> 0.102, >= 0.102.1)
24
+ avm-eac_webapp_base0 (~> 0.9)
25
+ eac_ruby_utils (~> 0.104)
26
26
  os (~> 1.1, >= 1.1.4)
27
27
  rouge (~> 3.30)
28
28
 
@@ -36,39 +36,39 @@ PATH
36
36
  PATH
37
37
  remote: sub/avm-eac_latex_base0
38
38
  specs:
39
- avm-eac_latex_base0 (0.2.0)
40
- avm (~> 0.41)
41
- avm-eac_webapp_base0 (~> 0.5, >= 0.5.1)
42
- eac_ruby_utils (~> 0.102)
39
+ avm-eac_latex_base0 (0.2.1)
40
+ avm (~> 0.45)
41
+ avm-eac_webapp_base0 (~> 0.9)
42
+ eac_ruby_utils (~> 0.104)
43
43
 
44
44
  PATH
45
45
  remote: sub/avm-eac_rails_base0
46
46
  specs:
47
- avm-eac_rails_base0 (0.8.0)
48
- avm-eac_rails_base1 (~> 0.6)
49
- eac_ruby_utils (~> 0.102)
47
+ avm-eac_rails_base0 (0.8.1)
48
+ avm-eac_rails_base1 (~> 0.7)
49
+ eac_ruby_utils (~> 0.104)
50
50
 
51
51
  PATH
52
52
  remote: sub/avm-eac_rails_base1
53
53
  specs:
54
- avm-eac_rails_base1 (0.6.0)
55
- avm (~> 0.41)
56
- avm-eac_ruby_base1 (~> 0.20)
57
- avm-eac_webapp_base0 (~> 0.6)
58
- eac_ruby_utils (~> 0.102)
54
+ avm-eac_rails_base1 (0.7.0)
55
+ avm (~> 0.45)
56
+ avm-eac_ruby_base1 (~> 0.21)
57
+ avm-eac_webapp_base0 (~> 0.9)
58
+ eac_ruby_utils (~> 0.104)
59
59
 
60
60
  PATH
61
61
  remote: sub/avm-eac_redmine_base0
62
62
  specs:
63
- avm-eac_redmine_base0 (0.15.0)
64
- avm (~> 0.43)
63
+ avm-eac_redmine_base0 (0.16.0)
64
+ avm (~> 0.44)
65
65
  avm-eac_generic_base0 (~> 0.5)
66
66
  avm-eac_rails_base1 (~> 0.6)
67
67
  avm-eac_ubuntu_base0 (~> 0.3)
68
68
  curb (~> 0.9, >= 0.9.11)
69
69
  eac_fs (~> 0.12, >= 0.12.3)
70
70
  eac_rest (~> 0.6, >= 0.6.1)
71
- eac_ruby_utils (~> 0.103)
71
+ eac_ruby_utils (~> 0.104)
72
72
 
73
73
  PATH
74
74
  remote: sub/avm-eac_redmine_plugin_base0
@@ -88,20 +88,20 @@ PATH
88
88
  PATH
89
89
  remote: sub/avm-eac_webapp_base0
90
90
  specs:
91
- avm-eac_webapp_base0 (0.8.0)
92
- avm (~> 0.42)
91
+ avm-eac_webapp_base0 (0.9.0)
92
+ avm (~> 0.45)
93
93
  avm-eac_generic_base0 (~> 0.5)
94
94
  avm-eac_postgresql_base0 (~> 0.2)
95
95
  avm-eac_ubuntu_base0 (~> 0.3)
96
- eac_ruby_utils (~> 0.103)
96
+ eac_ruby_utils (~> 0.104)
97
97
 
98
98
  PATH
99
99
  remote: sub/avm-eac_wordpress_base0
100
100
  specs:
101
- avm-eac_wordpress_base0 (0.2.0)
102
- avm (~> 0.41)
103
- avm-eac_webapp_base0 (~> 0.6)
104
- eac_ruby_utils (~> 0.102)
101
+ avm-eac_wordpress_base0 (0.2.1)
102
+ avm (~> 0.45)
103
+ avm-eac_webapp_base0 (~> 0.9)
104
+ eac_ruby_utils (~> 0.104)
105
105
 
106
106
  PATH
107
107
  remote: sub/avm-files
@@ -134,11 +134,11 @@ PATH
134
134
  PATH
135
135
  remote: sub/avm
136
136
  specs:
137
- avm (0.44.0)
137
+ avm (0.45.0)
138
138
  eac_cli (~> 0.28)
139
139
  eac_config (~> 0.11, >= 0.11.1)
140
140
  eac_docker (~> 0.4, >= 0.4.2)
141
- eac_git (~> 0.12, >= 0.12.2)
141
+ eac_git (~> 0.12, >= 0.12.3)
142
142
  eac_ruby_utils (~> 0.104)
143
143
  eac_templates (~> 0.3, >= 0.3.2)
144
144
  filesize (~> 0.2)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.31.1'
4
+ VERSION = '0.32.0'
5
5
  end
data/sub/avm/avm.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'eac_cli', '~> 0.28'
16
16
  s.add_dependency 'eac_config', '~> 0.11', '>= 0.11.1'
17
17
  s.add_dependency 'eac_docker', '~> 0.4', '>= 0.4.2'
18
- s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.2'
18
+ s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.3'
19
19
  s.add_dependency 'eac_ruby_utils', '~> 0.104'
20
20
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
21
21
  s.add_dependency 'filesize', '~> 0.2'
@@ -8,15 +8,22 @@ module Avm
8
8
  module AutoValues
9
9
  class Entry
10
10
  class << self
11
- def auto_value_method_name(suffix)
12
- "auto_#{suffix.to_s.gsub('.', '_')}"
11
+ # @param path [EacConfig::EntryPath]
12
+ # @return String
13
+ def auto_value_method_name(path)
14
+ "auto_#{::EacConfig::EntryPath.assert(path).to_string.gsub('.', '_')}"
13
15
  end
14
16
  end
15
17
 
16
- common_constructor :entries_provider, :suffix
18
+ # @!method initialize(entries_provider, path)
19
+ # @param entries_provider
20
+ # @param path [EacConfig::EntryPath]
21
+ common_constructor :entries_provider, :path do
22
+ self.path = ::EacConfig::EntryPath.assert(path)
23
+ end
17
24
 
18
25
  def auto_value_method
19
- self.class.auto_value_method_name(suffix)
26
+ self.class.auto_value_method_name(path)
20
27
  end
21
28
 
22
29
  def found?
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/entries/jobs/with_variables_source'
4
+ require 'avm/result'
5
+ require 'eac_cli/core_ext'
6
+
7
+ module Avm
8
+ module Entries
9
+ module Jobs
10
+ module Base
11
+ common_concern do
12
+ include ::ActiveSupport::Callbacks
13
+ include ::Avm::Entries::Jobs::WithVariablesSource
14
+
15
+ enable_speaker
16
+ enable_simple_cache
17
+ enable_listable
18
+ common_constructor :instance, :options, default: [{}] do
19
+ if option_list.present?
20
+ self.options = option_list.hash_keys_validate!(options.symbolize_keys)
21
+ end
22
+ end
23
+ define_callbacks(*jobs)
24
+ end
25
+
26
+ module ClassMethods
27
+ def jobs
28
+ const_get('JOBS').dup
29
+ end
30
+ end
31
+
32
+ module InstanceMethods
33
+ def option_list
34
+ nil
35
+ end
36
+
37
+ def run
38
+ start_banner if respond_to?(:start_banner)
39
+ run_jobs
40
+ ::Avm::Result.success('Done!')
41
+ rescue ::Avm::Result::Error => e
42
+ e.to_result
43
+ end
44
+
45
+ protected
46
+
47
+ def run_jobs
48
+ jobs.each do |job|
49
+ run_callbacks job do
50
+ send(job)
51
+ end
52
+ end
53
+ end
54
+
55
+ def jobs
56
+ self.class.jobs
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ module Jobs
8
+ class VariablesSource
9
+ class ReadEntry
10
+ enable_method_class
11
+ common_constructor :variables_source, :path, :options, default: [{}]
12
+ delegate :instance, :job, to: :variables_source
13
+
14
+ def result
15
+ return result_from_job if result_from_job?
16
+ return result_from_instance_method if result_from_instance_method?
17
+
18
+ result_from_instance_entry
19
+ end
20
+
21
+ private
22
+
23
+ def path_method_name
24
+ path.gsub('.', '_').underscore
25
+ end
26
+
27
+ def result_from_instance_entry
28
+ instance.read_entry(path, options)
29
+ end
30
+
31
+ def result_from_instance_method
32
+ instance.send(path_method_name)
33
+ end
34
+
35
+ def result_from_instance_method?
36
+ instance.respond_to?(path_method_name, true)
37
+ end
38
+
39
+ def result_from_job
40
+ job.send(path_method_name)
41
+ end
42
+
43
+ def result_from_job?
44
+ job.respond_to?(path_method_name, true)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ module Jobs
8
+ class VariablesSource
9
+ require_sub __FILE__, require_dependency: true
10
+ common_constructor :job
11
+ delegate :instance, to: :job
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/entries/jobs/variables_source'
4
+
5
+ module Avm
6
+ module Entries
7
+ module Jobs
8
+ module WithVariablesSource
9
+ def variables_source
10
+ ::Avm::Entries::Jobs::VariablesSource.new(self)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -3,7 +3,9 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module Jobs
7
- require_sub __FILE__
6
+ module Entries
7
+ module Jobs
8
+ require_sub __FILE__
9
+ end
8
10
  end
9
11
  end
@@ -13,7 +13,7 @@ module Avm
13
13
  end
14
14
 
15
15
  define_method "#{method_name}_optional" do
16
- read_entry(key, required: false)
16
+ read_entry_optional(key)
17
17
  end
18
18
  end
19
19
  end
@@ -35,7 +35,7 @@ module Avm
35
35
  '' => %w[id from reply_to],
36
36
  smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
37
37
  },
38
- web: URI_FIELDS + %w[authority userinfo]
38
+ web: URI_FIELDS
39
39
  }.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
40
40
  end
41
41
  end
@@ -5,17 +5,16 @@ require 'eac_ruby_utils/core_ext'
5
5
  module Avm
6
6
  module Rspec
7
7
  module Setup
8
- def self.extended(obj)
9
- obj.setup_in_avm_registry_example
10
- obj.setup_not_in_avm_registry_example
11
- end
8
+ EXAMPLES = %w[entries_values in_avm_registry not_in_avm_registry].freeze
12
9
 
13
- def setup_in_avm_registry_example
14
- require 'avm/rspec/shared_examples/in_avm_registry'
10
+ def self.extended(obj)
11
+ obj.setup_examples
15
12
  end
16
13
 
17
- def setup_not_in_avm_registry_example
18
- require 'avm/rspec/shared_examples/not_in_avm_registry'
14
+ def setup_examples
15
+ EXAMPLES.each do |example|
16
+ require "avm/rspec/shared_examples/#{example}"
17
+ end
19
18
  end
20
19
  end
21
20
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ ::RSpec.shared_examples 'entries_values' do |spec_file, expected_values|
6
+ describe '#read_entry' do
7
+ config_path = spec_file.to_pathname
8
+ config_path = config_path.dirname.join("#{config_path.basename_noext}_files", 'config.yml')
9
+ ::EacRubyUtils::Rspec.default_setup.stub_eac_config_node(self, config_path)
10
+
11
+ expected_values.each do |instance_id, values|
12
+ values.each do |input, expected|
13
+ context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
14
+ let(:instance) { described_class.by_id(instance_id) }
15
+
16
+ it ".read_entry should return \"#{expected}\"" do
17
+ expect(instance.read_entry(input)).to eq(expected)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.44.0'
4
+ VERSION = '0.45.0'
5
5
  end
@@ -4,105 +4,85 @@ require 'avm/instances/base'
4
4
  require 'avm/instances/entry_keys'
5
5
 
6
6
  RSpec.describe ::Avm::Instances::Base do
7
- let(:app2) { described_class.by_id('app_2') }
8
- let(:app1) { described_class.by_id('app_1') }
9
- let(:app0) { described_class.by_id('app_0') }
10
-
11
- ::EacRubyUtils::Rspec
12
- .default_setup
13
- .stub_eac_config_node(self, ::File.join(__dir__, 'base_spec_configs_storage.yml'))
14
-
15
- describe '#read_entry' do
16
- {
17
- 'app_0' => {
18
- ::Avm::Instances::EntryKeys::INSTALL_DATA_PATH => '/data_fs_root/app_0',
19
- ::Avm::Instances::EntryKeys::INSTALL_PATH => '/fs_root/app_0',
20
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
21
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
22
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
23
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
24
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
25
- ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'myhost.com',
26
- ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'myuser',
27
- ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'myuser',
28
- ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://otheruser@otherhost.com'
29
- },
30
- 'app_2' => {
31
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
32
- ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'myuser',
33
- ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
34
- },
35
- 'app_3' => {
36
- ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
37
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
38
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
39
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
40
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
41
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
42
- ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
43
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
44
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
45
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
46
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
47
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
48
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
49
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
50
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
51
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
52
- },
53
- 'app_4' => {
54
- ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
55
- ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host4.net',
56
- ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user4',
57
- ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'group4',
58
- ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://user4@host4.net'
59
- },
60
- 'app_5' => {
61
- ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
62
- ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host5.net',
63
- ::Avm::Instances::EntryKeys::INSTALL_PORT => '2222',
64
- ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user5',
65
- ::Avm::Instances::EntryKeys::INSTALL_PASSWORD => 'passwd5',
66
- ::Avm::Instances::EntryKeys::INSTALL_PATH => '/path/to/app5'
67
- },
68
- 'app_6' => {
69
- ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
70
- ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host5.net',
71
- ::Avm::Instances::EntryKeys::INSTALL_PORT => '2222',
72
- ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user5',
73
- ::Avm::Instances::EntryKeys::INSTALL_PASSWORD => 'passwd5',
74
- ::Avm::Instances::EntryKeys::INSTALL_PATH => '/path/to/app5/app_6'
75
- },
76
- 'mailer_0' => {
77
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
78
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
79
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
80
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
81
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
82
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
83
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
84
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
85
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
86
- }
87
- }.each do |instance_id, values|
88
- values.each do |input, expected|
89
- context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
90
- let(:instance) { described_class.by_id(instance_id) }
91
-
92
- it do
93
- expect(described_class.ancestors.map(&:name)).to(
94
- include('Avm::Instances::Base::Install')
95
- )
96
- end
97
-
98
- it ".read_entry should return \"#{expected}\"" do
99
- expect(instance.read_entry(input)).to eq(expected)
100
- end
101
- end
102
- end
103
- end
7
+ it do
8
+ expect(described_class.ancestors.map(&:name)).to(
9
+ include('Avm::Instances::Base::Install')
10
+ )
104
11
  end
105
12
 
13
+ include_examples 'entries_values', __FILE__, {
14
+ 'app_0' => {
15
+ ::Avm::Instances::EntryKeys::INSTALL_DATA_PATH => '/data_fs_root/app_0',
16
+ ::Avm::Instances::EntryKeys::INSTALL_PATH => '/fs_root/app_0',
17
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
18
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
19
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
20
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
21
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
22
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'myhost.com',
23
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'myuser',
24
+ ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'myuser',
25
+ ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://otheruser@otherhost.com'
26
+ },
27
+ 'app_2' => {
28
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
29
+ ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'myuser',
30
+ ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
31
+ },
32
+ 'app_3' => {
33
+ ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
34
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
35
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
36
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
37
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
38
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
39
+ ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
40
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
41
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
42
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
43
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
44
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
45
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
46
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
47
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
48
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
49
+ },
50
+ 'app_4' => {
51
+ ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
52
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host4.net',
53
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user4',
54
+ ::Avm::Instances::EntryKeys::INSTALL_GROUPNAME => 'group4',
55
+ ::Avm::Instances::EntryKeys::INSTALL_URL => 'ssh://user4@host4.net'
56
+ },
57
+ 'app_5' => {
58
+ ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
59
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host5.net',
60
+ ::Avm::Instances::EntryKeys::INSTALL_PORT => '2222',
61
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user5',
62
+ ::Avm::Instances::EntryKeys::INSTALL_PASSWORD => 'passwd5',
63
+ ::Avm::Instances::EntryKeys::INSTALL_PATH => '/path/to/app5'
64
+ },
65
+ 'app_6' => {
66
+ ::Avm::Instances::EntryKeys::INSTALL_SCHEME => 'ssh',
67
+ ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'host5.net',
68
+ ::Avm::Instances::EntryKeys::INSTALL_PORT => '2222',
69
+ ::Avm::Instances::EntryKeys::INSTALL_USERNAME => 'user5',
70
+ ::Avm::Instances::EntryKeys::INSTALL_PASSWORD => 'passwd5',
71
+ ::Avm::Instances::EntryKeys::INSTALL_PATH => '/path/to/app5/app_6'
72
+ },
73
+ 'mailer_0' => {
74
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
75
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
76
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
77
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
78
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
79
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
80
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
81
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
82
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
83
+ }
84
+ }
85
+
106
86
  describe '#by_id' do
107
87
  {
108
88
  'avm-tools_0' => %w[avm-tools 0],
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
15
  s.add_dependency 'asciidoctor', '~> 2.0', '>= 2.0.17'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.7'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.102', '>= 0.102.1'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.9'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.104'
18
18
  s.add_dependency 'os', '~> 1.1', '>= 1.1.4'
19
19
  s.add_dependency 'rouge', '~> 3.30'
20
20
 
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_webapp_base0/apache_host'
3
+ require 'avm/eac_webapp_base0/instances/apache_host'
4
4
 
5
5
  module Avm
6
6
  module EacAsciidoctorBase0
7
7
  module Instances
8
- class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
8
+ class ApacheHost < ::Avm::EacWebappBase0::Instances::ApacheHost
9
9
  def document_root
10
10
  instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH)
11
11
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_webapp_base0/apache_path'
3
+ require 'avm/eac_webapp_base0/instances/apache_path'
4
4
 
5
5
  module Avm
6
6
  module EacAsciidoctorBase0
7
7
  module Instances
8
- class ApachePath < ::Avm::EacWebappBase0::ApachePath
8
+ class ApachePath < ::Avm::EacWebappBase0::Instances::ApachePath
9
9
  end
10
10
  end
11
11
  end