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.
- checksums.yaml +4 -4
- data/Gemfile.lock +39 -19
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/applications/base.rb +2 -2
- data/sub/avm/lib/avm/entries/auto_values/entry.rb +32 -0
- data/sub/avm/lib/avm/entries/auto_values.rb +11 -0
- data/sub/avm/lib/avm/{instances/entries.rb → entries/base.rb} +9 -5
- data/sub/avm/lib/avm/{instances → entries}/entry.rb +3 -12
- data/sub/avm/lib/avm/entries.rb +9 -0
- data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +2 -2
- data/sub/avm/lib/avm/instances/base/auto_values/database.rb +1 -1
- data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +9 -8
- data/sub/avm/lib/avm/instances/base/auto_values/install.rb +4 -4
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +5 -4
- data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +1 -1
- data/sub/avm/lib/avm/instances/base/auto_values/system.rb +3 -3
- data/sub/avm/lib/avm/instances/base/auto_values.rb +3 -4
- data/sub/avm/lib/avm/instances/base.rb +6 -6
- data/sub/avm/lib/avm/instances/entry_keys.rb +2 -2
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/instances/base_spec.rb +50 -50
- data/sub/avm/spec/lib/avm/instances/base_spec_configs_storage.yml +4 -2
- data/sub/avm-eac_asciidoctor_base0/Gemfile +8 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/avm-eac_asciidoctor_base0.gemspec +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/deploy.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/instance.rb +0 -0
- 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
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +11 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/base.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/build.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources/runner.rb +0 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/build.rb +54 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners.rb +13 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/sources.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/lib/avm/eac_asciidoctor_base0.rb +0 -0
- 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
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/rubocop_spec.rb +0 -0
- data/sub/{avm-tools/sub/avm-eac_asciidoctor_base0 → avm-eac_asciidoctor_base0}/spec/spec_helper.rb +0 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/add_or_replace_gem_line.rb +62 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec/dependency.rb +19 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubygems/gemspec.rb +42 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/Gemfile +8 -0
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +78 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +62 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +11 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
- data/sub/avm-eac_wordpress_base0/Gemfile +8 -0
- data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +19 -0
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/apache_host.rb +27 -0
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +26 -0
- data/sub/{avm-tools/lib/avm/eac_wordpress_base0 → avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances}/deploy.rb +3 -1
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances.rb +11 -0
- 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
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/runners.rb +11 -0
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +7 -0
- data/sub/{avm-tools → avm-eac_wordpress_base0}/lib/avm/eac_wordpress_base0.rb +0 -0
- 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
- 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
- data/sub/avm-eac_wordpress_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_wordpress_base0/spec/spec_helper.rb +5 -0
- data/sub/{avm-tools → avm-eac_wordpress_base0}/template/avm/eac_wordpress_base0/deploy/wp-config.php.template +10 -10
- data/sub/avm-tools/avm-tools.gemspec +0 -1
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- metadata +127 -36
- data/sub/avm-tools/lib/avm/eac_wordpress_base0/apache_host.rb +0 -25
- data/sub/avm-tools/lib/avm/eac_wordpress_base0/instance.rb +0 -24
- data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +0 -56
- data/sub/avm-tools/lib/avm/tools/runner/app_src/eac_asciidoctor_base0.rb +0 -14
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 483fe35d1d7edbef046db2d18503575164208989b276d44207ef8931b4b43a39
|
4
|
+
data.tar.gz: 1955810083df4620b3b03228c68ebc7b9dfbd47403d0d318e5a3ebdef6f89ccc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
avm-
|
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.
|
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.
|
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.
|
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!
|
data/lib/eac_tools/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
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::
|
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
|
@@ -1,17 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/entries/entry'
|
5
5
|
|
6
6
|
module Avm
|
7
|
-
module
|
8
|
-
module
|
7
|
+
module Entries
|
8
|
+
module Base
|
9
|
+
def entries_provider_id
|
10
|
+
id
|
11
|
+
end
|
12
|
+
|
9
13
|
def entry(suffix, options = {})
|
10
|
-
::Avm::
|
14
|
+
::Avm::Entries::Entry.new(self, suffix, options)
|
11
15
|
end
|
12
16
|
|
13
17
|
def path_prefix
|
14
|
-
@path_prefix ||= [
|
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
|
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
|
-
|
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
|
@@ -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::
|
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::
|
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::
|
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::
|
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::
|
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
|
-
|
21
|
+
auto_fs_url_with_install || auto_fs_url_without_install
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
read_entry_optional(
|
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
|
-
"#{
|
28
|
+
"#{install_url}#{fs_path}"
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
|
-
def
|
33
|
-
return nil if read_entry_optional(
|
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::
|
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::
|
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::
|
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::
|
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/
|
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::
|
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::
|
21
|
+
inherited_entry_value(::Avm::Instances::EntryKeys::INSTALL_ID,
|
21
22
|
::Avm::Instances::EntryKeys::MAILER_ID) ||
|
22
|
-
read_entry_optional(::Avm::Instances::EntryKeys::
|
23
|
+
read_entry_optional(::Avm::Instances::EntryKeys::INSTALL_ID)
|
23
24
|
end
|
24
25
|
|
25
26
|
private
|
@@ -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::
|
12
|
-
read_entry_optional(
|
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::
|
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/
|
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
|
-
|
9
|
+
require_sub __FILE__
|
11
10
|
|
12
|
-
|
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/
|
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::
|
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
|
-
|
55
|
-
case
|
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(
|
58
|
-
else raise("Unmapped access value: \"#{
|
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
|
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]
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -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
|
-
|
17
|
-
{
|
18
|
-
'app_0'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
it "
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|