eac_tools 0.13.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +39 -19
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm/lib/avm/applications/base.rb +2 -2
  5. data/sub/avm/lib/avm/entries/auto_values/entry.rb +32 -0
  6. data/sub/avm/lib/avm/entries/auto_values.rb +11 -0
  7. data/sub/avm/lib/avm/{instances/entries.rb → entries/base.rb} +9 -5
  8. data/sub/avm/lib/avm/{instances → entries}/entry.rb +3 -12
  9. data/sub/avm/lib/avm/entries.rb +9 -0
  10. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
  11. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
  12. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
  13. data/sub/avm/lib/avm/instances/base/auto_values/install.rb +4 -4
  14. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +5 -4
  15. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
  16. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
  17. data/sub/avm/lib/avm/instances/base/auto_values.rb +3 -4
  18. data/sub/avm/lib/avm/instances/base.rb +6 -6
  19. data/sub/avm/lib/avm/instances/entry_keys.rb +2 -2
  20. data/sub/avm/lib/avm/version.rb +1 -1
  21. data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
  22. data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +4 -2
  23. data/sub/avm-eac_asciidoctor_base0/Gemfile +8 -0
  24. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/avm-eac_asciidoctor_base0.gemspec +0 -0
  25. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
  26. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
  27. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -0
  28. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/instance.rb +0 -0
  29. data/sub/{avm-tools/lib/avm/tools/runner/eac_asciidoctor_base0.rb → avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners/base.rb} +3 -4
  30. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +11 -0
  31. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -0
  32. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -0
  33. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -0
  34. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -0
  35. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -0
  36. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +54 -0
  37. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +13 -0
  38. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources.rb +0 -0
  39. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  40. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0.rb +0 -0
  41. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +0 -0
  42. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb +0 -0
  43. data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb +0 -0
  44. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
  45. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
  46. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
  47. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  48. data/sub/avm-eac_webapp_base0/Gemfile +8 -0
  49. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +22 -0
  50. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +78 -0
  51. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
  52. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
  53. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
  54. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
  55. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
  56. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
  57. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
  58. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
  59. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  60. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +62 -0
  61. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
  62. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
  63. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
  64. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
  65. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
  66. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
  67. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
  68. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
  69. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
  70. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
  71. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
  72. data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
  73. data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
  74. data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
  75. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +11 -0
  76. data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
  77. data/sub/avm-eac_wordpress_base0/Gemfile +8 -0
  78. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +19 -0
  79. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/apache_host.rb +27 -0
  80. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +26 -0
  81. data/sub/{avm-tools/lib/avm/eac_wordpress_base0 → avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances}/deploy.rb +3 -1
  82. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances.rb +11 -0
  83. data/sub/{avm-tools/lib/avm/tools/runner/eac_wordpress_base0.rb → avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/runners/base.rb} +3 -4
  84. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/runners.rb +11 -0
  85. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +7 -0
  86. data/sub/{avm-tools → avm-eac_wordpress_base0}/lib/avm/eac_wordpress_base0.rb +0 -0
  87. data/sub/{avm-tools/spec/lib/avm/eac_wordpress_base0 → avm-eac_wordpress_base0/spec/lib/avm/eac_wordpress_base0/instances}/apache_host_spec.rb +4 -4
  88. data/sub/{avm-tools/spec/lib/avm/eac_wordpress_base0 → avm-eac_wordpress_base0/spec/lib/avm/eac_wordpress_base0/instances}/apache_host_spec_no_ssl_content.conf +0 -0
  89. data/sub/avm-eac_wordpress_base0/spec/rubocop_spec.rb +3 -0
  90. data/sub/avm-eac_wordpress_base0/spec/spec_helper.rb +5 -0
  91. data/sub/{avm-tools → avm-eac_wordpress_base0}/template/avm/eac_wordpress_base0/deploy/wp-config.php.template +10 -10
  92. data/sub/avm-tools/avm-tools.gemspec +0 -1
  93. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  94. metadata +127 -36
  95. data/sub/avm-tools/lib/avm/eac_wordpress_base0/apache_host.rb +0 -25
  96. data/sub/avm-tools/lib/avm/eac_wordpress_base0/instance.rb +0 -24
  97. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
  98. data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
  99. data/sub/avm-tools/sub/avm-eac_asciidoctor_base0/Gemfile +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bf2ba914845ef4487ca80e47097879d283ece113e6cbe0863a9f54920b605d7
4
- data.tar.gz: b9c45a9db9dba67f8c742bf689a1b267480c40b8312ec066dfe25aabf8f66ec6
3
+ metadata.gz: 483fe35d1d7edbef046db2d18503575164208989b276d44207ef8931b4b43a39
4
+ data.tar.gz: 1955810083df4620b3b03228c68ebc7b9dfbd47403d0d318e5a3ebdef6f89ccc
5
5
  SHA512:
6
- metadata.gz: de155498ec4b29e4391433f4fe3fb5a9509f15f92d5b4106b1e402026e7349d3887bb4b75bedf96bcb22281ba606149bd17be4ba67dad2d3bb4c741dc4f2a237
7
- data.tar.gz: 0e738279dd36f46a1bc247d71fb2165ad0b5537e7050874a3705ee3b85c0b353e490535b3e74c7d6960ac17df6c0a8ab9c5f5ad371a7de7a524ad266faae4e6c
6
+ metadata.gz: ff15828b3b75b1e625b80681bf3ef1bc5069e7e07d0a770c50e20b7e4b40132ebf322d63d75bfcf64041a336130e733fed0690c0445473ed1d80fbef6d6e964b
7
+ data.tar.gz: 193fd20c6f955468dec78935d3046dc312b6b454e1c6ec2760e516c637427b94d1c4413ef2255c41595b26eba3cc6824e490531619c040d6193a208dc73f42e7
data/Gemfile.lock CHANGED
@@ -1,16 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.13.0)
4
+ eac_tools (0.16.0)
5
+ avm-eac_asciidoctor_base0 (~> 0.4)
5
6
  avm-eac_generic_base0 (~> 0.4)
6
7
  avm-eac_rails_base0 (~> 0.6, >= 0.6.1)
7
8
  avm-eac_rails_base1 (~> 0.4, >= 0.4.2)
8
9
  avm-eac_redmine_base0 (~> 0.11)
9
10
  avm-eac_redmine_plugin_base0 (~> 0.3)
10
- avm-eac_ruby_base1 (~> 0.11)
11
- avm-tools (~> 0.127)
11
+ avm-eac_ruby_base1 (~> 0.12)
12
+ avm-eac_webapp_base0 (~> 0.3, >= 0.3.1)
13
+ avm-eac_wordpress_base0 (~> 0.1)
14
+ avm-tools (~> 0.129)
12
15
  eac_ruby_utils (~> 0.97)
13
16
 
17
+ PATH
18
+ remote: sub/avm-eac_asciidoctor_base0
19
+ specs:
20
+ avm-eac_asciidoctor_base0 (0.4.0)
21
+ asciidoctor (~> 2.0, >= 2.0.12)
22
+ avm-eac_webapp_base0 (~> 0.2)
23
+ eac_ruby_utils (~> 0.63)
24
+ os
25
+ rouge (~> 3.26)
26
+
14
27
  PATH
15
28
  remote: sub/avm-eac_generic_base0
16
29
  specs:
@@ -57,18 +70,34 @@ PATH
57
70
  PATH
58
71
  remote: sub/avm-eac_ruby_base1
59
72
  specs:
60
- avm-eac_ruby_base1 (0.11.0)
73
+ avm-eac_ruby_base1 (0.12.0)
61
74
  avm (~> 0.26)
62
75
  avm-eac_generic_base0 (~> 0.2)
63
76
  eac_ruby_utils (~> 0.95, >= 0.95.1)
64
77
 
78
+ PATH
79
+ remote: sub/avm-eac_webapp_base0
80
+ specs:
81
+ avm-eac_webapp_base0 (0.3.1)
82
+ avm (~> 0.1)
83
+ avm-eac_generic_base0 (~> 0.1)
84
+ avm-eac_postgresql_base0 (~> 0.1)
85
+ avm-eac_ubuntu_base0 (~> 0.3)
86
+ eac_ruby_utils (~> 0.68)
87
+
88
+ PATH
89
+ remote: sub/avm-eac_wordpress_base0
90
+ specs:
91
+ avm-eac_wordpress_base0 (0.1.0)
92
+ avm-eac_webapp_base0 (~> 0.3, >= 0.3.1)
93
+ eac_ruby_utils (~> 0.97)
94
+
65
95
  PATH
66
96
  remote: sub/avm-tools
67
97
  specs:
68
- avm-tools (0.127.0)
98
+ avm-tools (0.129.0)
69
99
  aranha-parsers (~> 0.4)
70
100
  avm (~> 0.30)
71
- avm-eac_asciidoctor_base0 (~> 0.3, >= 0.3.4)
72
101
  avm-eac_ruby_base1 (~> 0.8)
73
102
  avm-eac_ubuntu_base0 (~> 0.3)
74
103
  avm-files (~> 0.1)
@@ -82,7 +111,7 @@ PATH
82
111
  PATH
83
112
  remote: sub/avm
84
113
  specs:
85
- avm (0.31.0)
114
+ avm (0.33.0)
86
115
  eac_cli (~> 0.27, >= 0.27.6)
87
116
  eac_config (~> 0.10)
88
117
  eac_docker (~> 0.3)
@@ -164,12 +193,6 @@ GEM
164
193
  ofx-parser (~> 1.1.0)
165
194
  asciidoctor (2.0.17)
166
195
  ast (2.4.2)
167
- avm-eac_asciidoctor_base0 (0.3.4)
168
- asciidoctor (~> 2.0, >= 2.0.12)
169
- avm-eac_webapp_base0 (~> 0.2)
170
- eac_ruby_utils (~> 0.63)
171
- os
172
- rouge (~> 3.26)
173
196
  avm-eac_postgresql_base0 (0.2.0)
174
197
  avm (~> 0.12, >= 0.12.1)
175
198
  eac_ruby_utils (~> 0.82)
@@ -177,12 +200,6 @@ GEM
177
200
  avm (~> 0.7)
178
201
  eac_ruby_utils (~> 0.77, >= 0.77.1)
179
202
  eac_templates (~> 0.3)
180
- avm-eac_webapp_base0 (0.3.0)
181
- avm (~> 0.1)
182
- avm-eac_generic_base0 (~> 0.1)
183
- avm-eac_postgresql_base0 (~> 0.1)
184
- avm-eac_ubuntu_base0 (~> 0.3)
185
- eac_ruby_utils (~> 0.68)
186
203
  avm-files (0.3.2)
187
204
  avm (~> 0.6)
188
205
  eac_fs (~> 0.5)
@@ -310,12 +327,15 @@ PLATFORMS
310
327
 
311
328
  DEPENDENCIES
312
329
  avm!
330
+ avm-eac_asciidoctor_base0!
313
331
  avm-eac_generic_base0!
314
332
  avm-eac_rails_base0!
315
333
  avm-eac_rails_base1!
316
334
  avm-eac_redmine_base0!
317
335
  avm-eac_redmine_plugin_base0!
318
336
  avm-eac_ruby_base1!
337
+ avm-eac_webapp_base0!
338
+ avm-eac_wordpress_base0!
319
339
  avm-tools!
320
340
  eac_cli!
321
341
  eac_config!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.13.0'
4
+ VERSION = '0.16.0'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/entries'
3
+ require 'avm/entries/base'
4
4
  require 'avm/registry'
5
5
  require 'eac_ruby_utils/core_ext'
6
6
 
@@ -9,7 +9,7 @@ module Avm
9
9
  class Base
10
10
  enable_simple_cache
11
11
  require_sub __FILE__, include_modules: true
12
- include ::Avm::Instances::Entries
12
+ include ::Avm::Entries::Base
13
13
 
14
14
  LOCAL_INSTANCE_SUFFIX = 'dev'
15
15
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/node'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Entries
8
+ module AutoValues
9
+ class Entry
10
+ class << self
11
+ def auto_value_method_name(suffix)
12
+ "auto_#{suffix.to_s.gsub('.', '_')}"
13
+ end
14
+ end
15
+
16
+ common_constructor :entries_provider, :suffix
17
+
18
+ def auto_value_method
19
+ self.class.auto_value_method_name(suffix)
20
+ end
21
+
22
+ def found?
23
+ entries_provider.respond_to?(auto_value_method, true)
24
+ end
25
+
26
+ def value
27
+ entries_provider.if_respond(auto_value_method)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ module AutoValues
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -1,17 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
- require 'avm/instances/entry'
4
+ require 'avm/entries/entry'
5
5
 
6
6
  module Avm
7
- module Instances
8
- module Entries
7
+ module Entries
8
+ module Base
9
+ def entries_provider_id
10
+ id
11
+ end
12
+
9
13
  def entry(suffix, options = {})
10
- ::Avm::Instances::Entry.new(self, suffix, options)
14
+ ::Avm::Entries::Entry.new(self, suffix, options)
11
15
  end
12
16
 
13
17
  def path_prefix
14
- @path_prefix ||= [id].freeze
18
+ @path_prefix ||= [entries_provider_id].freeze
15
19
  end
16
20
 
17
21
  def read_entry(entry_suffix, options = {})
@@ -1,25 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/entries/auto_values/entry'
3
4
  require 'eac_config/node'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
 
6
7
  module Avm
7
- module Instances
8
+ module Entries
8
9
  class Entry
9
- class << self
10
- def auto_value_method_name(suffix)
11
- "auto_#{suffix.to_s.gsub('.', '_')}"
12
- end
13
- end
14
-
15
10
  common_constructor :parent, :suffix, :options
16
11
 
17
12
  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)
13
+ ::Avm::Entries::AutoValues::Entry.new(parent, suffix).value
23
14
  end
24
15
 
25
16
  def full_path
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Entries
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -6,11 +6,11 @@ module Avm
6
6
  module AutoValues
7
7
  module Admin
8
8
  def auto_admin_email
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.email')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.email')
10
10
  end
11
11
 
12
12
  def auto_admin_name
13
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'admin.name')
13
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'admin.name')
14
14
  end
15
15
  end
16
16
  end
@@ -61,7 +61,7 @@ module Avm
61
61
  def database_auto_common(suffix)
62
62
  database_key = ::Avm::Instances::EntryKeys.const_get("database_#{suffix}".upcase)
63
63
  inherited_entry_value(::Avm::Instances::EntryKeys::DATABASE_ID, database_key) ||
64
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, database_key)
64
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, database_key)
65
65
  end
66
66
 
67
67
  def database_port_by_system
@@ -8,29 +8,30 @@ module Avm
8
8
  module AutoValues
9
9
  module Filesystem
10
10
  def auto_fs_path
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
12
12
  ::Avm::Instances::EntryKeys::FS_PATH) { |v| v + '/' + id }
13
13
  end
14
14
 
15
15
  def auto_data_fs_path
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
17
17
  ::Avm::Instances::EntryKeys::DATA_FS_PATH) { |v| v + '/' + id }
18
18
  end
19
19
 
20
20
  def auto_fs_url
21
- auto_fs_url_with_ssh || auto_fs_url_without_ssh
21
+ auto_fs_url_with_install || auto_fs_url_without_install
22
22
  end
23
23
 
24
- def auto_fs_url_with_ssh
25
- read_entry_optional('ssh.url').if_present do |ssh_url|
24
+ def auto_fs_url_with_install
25
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL)
26
+ .if_present do |install_url|
26
27
  read_entry_optional('fs_path').if_present do |fs_path|
27
- "#{ssh_url}#{fs_path}"
28
+ "#{install_url}#{fs_path}"
28
29
  end
29
30
  end
30
31
  end
31
32
 
32
- def auto_fs_url_without_ssh
33
- return nil if read_entry_optional('ssh.url').present?
33
+ def auto_fs_url_without_install
34
+ return nil if read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_URL).present?
34
35
 
35
36
  read_entry_optional('fs_path').if_present do |fs_path|
36
37
  "file://#{fs_path}"
@@ -12,22 +12,22 @@ module Avm
12
12
  end
13
13
 
14
14
  def auto_install_hostname
15
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
15
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
16
16
  ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME)
17
17
  end
18
18
 
19
19
  def auto_install_port
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
20
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
21
  ::Avm::Instances::EntryKeys::INSTALL_PORT) || 22
22
22
  end
23
23
 
24
24
  def auto_install_username
25
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
25
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
26
26
  ::Avm::Instances::EntryKeys::INSTALL_USERNAME)
27
27
  end
28
28
 
29
29
  def auto_install_url
30
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
30
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
31
31
  ::Avm::Instances::EntryKeys::INSTALL_URL) ||
32
32
  auto_install_url_by_parts
33
33
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/entry'
3
+ require 'avm/entries/auto_values/entry'
4
+ require 'avm/entries/entry'
4
5
  require 'avm/instances/entry_keys'
5
6
 
6
7
  module Avm
@@ -11,15 +12,15 @@ module Avm
11
12
  ::Avm::Instances::EntryKeys.all.select { |c| c.to_s.start_with?('mailer.') }
12
13
  .reject { |c| c == ::Avm::Instances::EntryKeys::MAILER_ID }
13
14
  .each do |mailer_key|
14
- define_method ::Avm::Instances::Entry.auto_value_method_name(mailer_key) do
15
+ define_method ::Avm::Entries::AutoValues::Entry.auto_value_method_name(mailer_key) do
15
16
  mailer_auto_common(mailer_key)
16
17
  end
17
18
  end
18
19
 
19
20
  def auto_mailer_id
20
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID,
21
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
21
22
  ::Avm::Instances::EntryKeys::MAILER_ID) ||
22
- read_entry_optional(::Avm::Instances::EntryKeys::HOST_ID)
23
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_ID)
23
24
  end
24
25
 
25
26
  private
@@ -6,7 +6,7 @@ module Avm
6
6
  module AutoValues
7
7
  module Ruby
8
8
  def auto_ruby_version
9
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ruby.version')
9
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'ruby.version')
10
10
  end
11
11
  end
12
12
  end
@@ -8,12 +8,12 @@ module Avm
8
8
  module AutoValues
9
9
  module System
10
10
  def auto_system_username
11
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.username') ||
12
- read_entry_optional('ssh.username')
11
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.username') ||
12
+ read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_USERNAME)
13
13
  end
14
14
 
15
15
  def auto_system_groupname
16
- inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'system.groupname') ||
16
+ inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID, 'system.groupname') ||
17
17
  read_entry_optional('system.username')
18
18
  end
19
19
  end
@@ -1,15 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_utils/require_sub'
4
- ::EacRubyUtils.require_sub(__FILE__)
3
+ require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
7
6
  module Instances
8
7
  class Base
9
8
  module AutoValues
10
- extend ::ActiveSupport::Concern
9
+ require_sub __FILE__
11
10
 
12
- included do
11
+ common_concern do
13
12
  %w[Admin Data Database Filesystem Install Mailer Ruby Source System Web]
14
13
  .each do |class_name|
15
14
  include const_get(class_name)
@@ -4,7 +4,7 @@ require 'avm/with/application_stereotype'
4
4
  require 'avm/with/extra_subcommands'
5
5
  require 'eac_ruby_utils/require_sub'
6
6
  require 'eac_ruby_utils/simple_cache'
7
- require 'avm/instances/entries'
7
+ require 'avm/entries/base'
8
8
 
9
9
  module Avm
10
10
  module Instances
@@ -13,7 +13,7 @@ module Avm
13
13
  enable_listable
14
14
  enable_simple_cache
15
15
  require_sub __FILE__, include_modules: true
16
- include ::Avm::Instances::Entries
16
+ include ::Avm::Entries::Base
17
17
  include ::Avm::With::ExtraSubcommands
18
18
  include ::Avm::With::ApplicationStereotype
19
19
 
@@ -51,11 +51,11 @@ module Avm
51
51
  end
52
52
 
53
53
  def host_env_uncached
54
- access = read_entry(:access, list: ::Avm::Instances::Base.lists.access.values)
55
- case access
54
+ install_uri = entry(::Avm::Instances::EntryKeys::INSTALL_URL).value.to_uri
55
+ case install_uri.scheme
56
56
  when 'local' then ::EacRubyUtils::Envs.local
57
- when 'ssh' then ::EacRubyUtils::Envs.ssh(read_entry('ssh.url'))
58
- else raise("Unmapped access value: \"#{access}\"")
57
+ when 'ssh' then ::EacRubyUtils::Envs.ssh(install_uri)
58
+ else raise("Unmapped access value: \"#{install_uri}\"")
59
59
  end
60
60
  end
61
61
 
@@ -44,12 +44,12 @@ module Avm
44
44
  end
45
45
 
46
46
  {
47
- '' => %w[data_fs_path fs_path host_id name source_instance_id],
47
+ '' => %w[data_fs_path fs_path name source_instance_id],
48
48
  admin: URI_FIELDS + %w[api_key],
49
49
  database: URI_FIELDS + %w[id limit name system timeout extra],
50
50
  docker: %w[registry],
51
51
  fs: %w[url],
52
- install: URI_FIELDS,
52
+ install: URI_FIELDS + %w[id],
53
53
  mailer: {
54
54
  '' => %w[id from reply_to],
55
55
  smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.31.0'
4
+ VERSION = '0.33.0'
5
5
  end
@@ -13,56 +13,56 @@ RSpec.describe ::Avm::Instances::Base do
13
13
  .stub_eac_config_node(self, ::File.join(__dir__, 'base_spec_configs_storage.yml'))
14
14
 
15
15
  describe '#read_entry' do
16
- context 'when a auto value is requested' do
17
- {
18
- 'app_0' => {
19
- fs_path: '/fs_root/app_0',
20
- data_fs_path: '/data_fs_root/app_0',
21
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_0',
22
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
23
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
24
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
25
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
26
- ::Avm::Instances::EntryKeys::INSTALL_HOSTNAME => 'myhost.com',
27
- ::Avm::Instances::EntryKeys::INSTALL_USERNAME => '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::SOURCE_INSTANCE_ID => 'app_dev'
33
- },
34
- 'app_3' => {
35
- ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
36
- ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
37
- ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
38
- ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
39
- ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
40
- ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
41
- ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
42
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
43
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
44
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
45
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
46
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
47
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
48
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
49
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
50
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
51
- },
52
- 'mailer_0' => {
53
- ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
54
- ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
55
- ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
56
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
57
- ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
58
- ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
59
- ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
60
- ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
61
- ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
62
- }
63
- }.each do |instance_id, values|
64
- values.each do |input, expected|
65
- it "read entry #{instance_id}.#{input} should return \"#{expected}\"" do
16
+ {
17
+ 'app_0' => {
18
+ fs_path: '/fs_root/app_0',
19
+ data_fs_path: '/data_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_URL => 'ssh://otheruser@otherhost.com'
28
+ },
29
+ 'app_2' => {
30
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => '127.0.0.1',
31
+ ::Avm::Instances::EntryKeys::SOURCE_INSTANCE_ID => 'app_dev'
32
+ },
33
+ 'app_3' => {
34
+ ::Avm::Instances::EntryKeys::DATABASE_SYSTEM => 'postgresql',
35
+ ::Avm::Instances::EntryKeys::DATABASE_NAME => 'app_1_db',
36
+ ::Avm::Instances::EntryKeys::DATABASE_USERNAME => 'user1',
37
+ ::Avm::Instances::EntryKeys::DATABASE_PASSWORD => 'pass1',
38
+ ::Avm::Instances::EntryKeys::DATABASE_HOSTNAME => 'database.net',
39
+ ::Avm::Instances::EntryKeys::DATABASE_PORT => 5432,
40
+ ::Avm::Instances::EntryKeys::MAILER_ID => 'mailer_0',
41
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
42
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => nil,
43
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
44
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
45
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
46
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
47
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
48
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
49
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
50
+ },
51
+ 'mailer_0' => {
52
+ ::Avm::Instances::EntryKeys::MAILER_FROM => 'noreply@example.net',
53
+ ::Avm::Instances::EntryKeys::MAILER_REPLY_TO => '',
54
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_ADDRESS => 'smtp.example.net',
55
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PORT => '587',
56
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_DOMAIN => 'example.net',
57
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_USERNAME => 'a_user',
58
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_PASSWORD => 'a_secret',
59
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_AUTHENTICATION => 'plain',
60
+ ::Avm::Instances::EntryKeys::MAILER_SMTP_STARTTLS_AUTO => 'true'
61
+ }
62
+ }.each do |instance_id, values|
63
+ values.each do |input, expected|
64
+ context "when a auto value is requested for \"#{instance_id}.#{input}\"" do
65
+ it ".read_entry should return \"#{expected}\"" do
66
66
  expect(described_class.by_id(instance_id).read_entry(input)).to eq(expected)
67
67
  end
68
68
  end
@@ -1,10 +1,12 @@
1
1
  ---
2
2
  app_0:
3
- host_id: app_1
3
+ install:
4
+ id: app_1
4
5
  app_1:
5
6
  fs_path: /fs_root
6
7
  data_fs_path: /data_fs_root
7
- host_id: app_2
8
+ install:
9
+ id: app_2
8
10
  database:
9
11
  name: app_1_db
10
12
  username: user1
@@ -0,0 +1,8 @@
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)