avm-tools 0.88.0 → 0.93.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_asciidoctor_base0.rb +9 -0
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/apache_host.rb +1 -1
- data/lib/avm/eac_asciidoctor_base0/apache_path.rb +10 -0
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/build.rb +5 -3
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/build/file.rb +4 -4
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/deploy.rb +6 -6
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/instance.rb +1 -1
- data/lib/avm/{eac_writings_base1 → eac_asciidoctor_base0}/project.rb +1 -1
- data/lib/avm/eac_rails_base0/apache_path.rb +6 -38
- data/lib/avm/eac_webapp_base0/apache_host.rb +7 -31
- data/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
- data/lib/avm/eac_webapp_base0/deploy.rb +17 -23
- data/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +1 -1
- data/lib/avm/eac_webapp_base0/deploy/git_info.rb +1 -1
- data/lib/avm/eac_webapp_base0/instance.rb +2 -0
- data/lib/avm/eac_webapp_base0/runner/apache_host.rb +7 -10
- data/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +6 -15
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +18 -24
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +12 -23
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +13 -21
- data/lib/avm/executables.rb +1 -1
- data/lib/avm/git/auto_commit/commit_info.rb +22 -0
- data/lib/avm/git/auto_commit/rules.rb +31 -0
- data/lib/avm/git/auto_commit/rules/base.rb +39 -0
- data/lib/avm/git/auto_commit/rules/last.rb +19 -0
- data/lib/avm/git/auto_commit/rules/manual.rb +45 -0
- data/lib/avm/git/auto_commit/rules/nth.rb +23 -0
- data/lib/avm/git/auto_commit/rules/unique.rb +21 -0
- data/lib/avm/git/file_auto_fixup.rb +15 -62
- data/lib/avm/tools/runner/{eac_writings_base1.rb → eac_asciidoctor_base0.rb} +2 -2
- data/lib/avm/tools/runner/eac_webapp_base0.rb +14 -0
- data/lib/avm/tools/runner/git/auto_commit.rb +12 -13
- data/lib/avm/tools/runner/git/auto_fixup.rb +9 -9
- data/lib/avm/tools/runner/git/commit.rb +11 -20
- data/lib/avm/tools/runner/local_project/{eac_writings_base1.rb → eac_asciidoctor_base0.rb} +2 -2
- data/lib/avm/tools/runner/local_project/{eac_writings_base1 → eac_asciidoctor_base0}/build.rb +5 -9
- data/lib/avm/tools/runner/local_project/ruby.rb +1 -1
- data/lib/avm/tools/runner/local_project/ruby/bundler.rb +1 -1
- data/lib/avm/tools/runner/local_project/ruby/bundler/gemfile_lock.rb +1 -1
- data/lib/avm/tools/runner/ruby.rb +6 -14
- data/lib/avm/tools/runner/ruby/gems.rb +4 -7
- data/lib/avm/tools/runner/ruby/gems/generate.rb +12 -23
- data/lib/avm/tools/runner/ruby/rubocop.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/eac_rails_base0/apache_path/extra_content.conf +5 -0
- data/template/avm/eac_webapp_base0/apache_path/default.conf +9 -0
- data/vendor/avm-apps/Gemfile +5 -0
- data/vendor/avm-apps/avm-apps.gemspec +18 -0
- data/{lib/avm/eac_writings_base1.rb → vendor/avm-apps/lib/avm/apps.rb} +1 -1
- data/vendor/avm-apps/lib/avm/apps/jobs.rb +11 -0
- data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +64 -0
- data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +24 -0
- data/vendor/avm-apps/lib/avm/apps/version.rb +7 -0
- data/vendor/avm-apps/spec/rubocop_spec.rb +7 -0
- data/vendor/avm-apps/spec/spec_helper.rb +100 -0
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +8 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +21 -9
- data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +8 -0
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +12 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +15 -1
- data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +3 -17
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +21 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- metadata +55 -15
- data/lib/avm/tools/runner/eac_rails_base0/apache_path.rb +0 -38
- data/template/avm/eac_rails_base0/apache_path/default.conf +0 -13
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6d2b367a6cca1ba76094f9847bfc4155a3c9abe9665b582c572cb35567320b
|
4
|
+
data.tar.gz: 3aea3baa7f0e41dc0566d2d4411e1cf4c78e852aae4787f33d002a274dd4f3b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73222b5a84ab23aacbc5088f0c9a297babcae52fa5427ebcae52053c697250ac4aa8a3e91940a4f82dd5d5f5bf39f12fb730c1d9883ae44cccf606419a241117
|
7
|
+
data.tar.gz: f76583694406760f366788cc4535095604adf4eaaf784350d425d3d820764c4a531a317fde4ddab56abd496b85895cf55dc9825046c3c4fa09059d66934d4992
|
@@ -4,7 +4,7 @@ require 'eac_ruby_utils/core_ext'
|
|
4
4
|
require 'eac_ruby_utils/fs/clearable_directory'
|
5
5
|
|
6
6
|
module Avm
|
7
|
-
module
|
7
|
+
module EacAsciidoctorBase0
|
8
8
|
class Build
|
9
9
|
require_sub __FILE__
|
10
10
|
enable_console_speaker
|
@@ -15,6 +15,8 @@ module Avm
|
|
15
15
|
self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys)
|
16
16
|
end
|
17
17
|
|
18
|
+
SOURCE_EXTNAMES = %w[.adoc .asc].freeze
|
19
|
+
|
18
20
|
def run
|
19
21
|
infov 'Files to build', source_files.count
|
20
22
|
target_directory.clear
|
@@ -34,9 +36,9 @@ module Avm
|
|
34
36
|
def source_files_uncached
|
35
37
|
r = []
|
36
38
|
project.root.children.each do |child|
|
37
|
-
next unless child.extname
|
39
|
+
next unless SOURCE_EXTNAMES.include?(child.extname)
|
38
40
|
|
39
|
-
r << ::Avm::
|
41
|
+
r << ::Avm::EacAsciidoctorBase0::Build::File.new(self, child.basename)
|
40
42
|
end
|
41
43
|
r
|
42
44
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'asciidoctor'
|
4
4
|
|
5
5
|
module Avm
|
6
|
-
module
|
6
|
+
module EacAsciidoctorBase0
|
7
7
|
class Build
|
8
8
|
class File
|
9
9
|
enable_console_speaker
|
@@ -11,8 +11,8 @@ module Avm
|
|
11
11
|
|
12
12
|
def run
|
13
13
|
infov 'Building', subpath
|
14
|
-
|
15
|
-
|
14
|
+
::Asciidoctor.convert_file source_path.to_path,
|
15
|
+
to_file: target_path.to_path, safe: :unsafe, mkdirs: true
|
16
16
|
end
|
17
17
|
|
18
18
|
def source_path
|
@@ -1,23 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_webapp_base0/deploy'
|
4
|
-
require 'avm/
|
5
|
-
require 'avm/
|
4
|
+
require 'avm/eac_asciidoctor_base0/project'
|
5
|
+
require 'avm/eac_asciidoctor_base0/build'
|
6
6
|
|
7
7
|
module Avm
|
8
|
-
module
|
8
|
+
module EacAsciidoctorBase0
|
9
9
|
class Deploy < ::Avm::EacWebappBase0::Deploy
|
10
10
|
def build_content
|
11
|
-
::Avm::
|
11
|
+
::Avm::EacAsciidoctorBase0::Build.new(
|
12
12
|
project,
|
13
|
-
::Avm::
|
13
|
+
::Avm::EacAsciidoctorBase0::Build::OPTION_TARGET_DIRECTORY => build_dir
|
14
14
|
).run
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def project_uncached
|
20
|
-
::Avm::
|
20
|
+
::Avm::EacAsciidoctorBase0::Project.new(
|
21
21
|
instance.source_instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
22
22
|
)
|
23
23
|
end
|
@@ -1,49 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/apache_path'
|
4
4
|
require 'eac_ruby_utils/core_ext'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module EacRailsBase0
|
8
|
-
class ApachePath
|
9
|
-
|
10
|
-
|
11
|
-
common_constructor :instance, :options, default: [{}]
|
12
|
-
|
13
|
-
def run
|
14
|
-
write_available_conf
|
15
|
-
enable_conf
|
16
|
-
reload_apache
|
17
|
-
::Avm::Result.success('Done')
|
18
|
-
end
|
19
|
-
|
20
|
-
def content
|
21
|
-
template.child('default.conf').apply(instance)
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def apache_uncached
|
27
|
-
::Avm::EacUbuntuBase0::Apache.new(instance.host_env)
|
28
|
-
end
|
29
|
-
|
30
|
-
def enable_conf
|
31
|
-
infom 'Enabling configuration...'
|
32
|
-
conf.enable
|
33
|
-
end
|
34
|
-
|
35
|
-
def reload_apache
|
36
|
-
infom 'Reloading Apache...'
|
37
|
-
apache.service('reload')
|
38
|
-
end
|
39
|
-
|
40
|
-
def conf_uncached
|
41
|
-
apache.conf(instance.id)
|
8
|
+
class ApachePath < ::Avm::EacWebappBase0::ApachePath
|
9
|
+
def document_root
|
10
|
+
::File.join(super, 'public')
|
42
11
|
end
|
43
12
|
|
44
|
-
def
|
45
|
-
|
46
|
-
conf.write(content)
|
13
|
+
def extra_content
|
14
|
+
template.child('extra_content.conf').apply(instance)
|
47
15
|
end
|
48
16
|
end
|
49
17
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avm/apps/jobs/base'
|
4
5
|
require 'avm/patches/object/template'
|
5
6
|
require 'avm/eac_ubuntu_base0/apache'
|
6
7
|
require 'avm/patches/object/template'
|
@@ -8,24 +9,14 @@ require 'avm/patches/object/template'
|
|
8
9
|
module Avm
|
9
10
|
module EacWebappBase0
|
10
11
|
class ApacheHost
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
def run
|
16
|
-
write_available_no_ssl_site
|
17
|
-
enable_no_ssl_site
|
18
|
-
remove_ssl_site
|
19
|
-
reload_apache
|
20
|
-
run_certbot
|
21
|
-
enable_ssl_site
|
22
|
-
reload_apache
|
23
|
-
::Avm::Result.success('Done')
|
24
|
-
end
|
12
|
+
JOBS = %w[write_available_no_ssl_site enable_no_ssl_site remove_ssl_site reload_apache
|
13
|
+
run_certbot enable_ssl_site reload_apache].freeze
|
14
|
+
include ::Avm::Apps::Jobs::Base
|
25
15
|
|
26
16
|
def no_ssl_site_content
|
27
|
-
::Avm::EacWebappBase0::ApacheHost
|
28
|
-
|
17
|
+
::Avm::EacWebappBase0::ApacheHost
|
18
|
+
.template.child('no_ssl.conf')
|
19
|
+
.apply(variables_source)
|
29
20
|
end
|
30
21
|
|
31
22
|
def ssl?
|
@@ -83,21 +74,6 @@ module Avm
|
|
83
74
|
infom 'Writing no SSL site conf...'
|
84
75
|
no_ssl_site.write(no_ssl_site_content)
|
85
76
|
end
|
86
|
-
|
87
|
-
class EntriesReader
|
88
|
-
common_constructor :job, :instance
|
89
|
-
|
90
|
-
def read_entry(path, options = {})
|
91
|
-
entry_from_job(path) || instance.read_entry(path, options)
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def entry_from_job(path)
|
97
|
-
method = path.gsub('.', '_').underscore
|
98
|
-
return job.send(method) if job.respond_to?(method, true)
|
99
|
-
end
|
100
|
-
end
|
101
77
|
end
|
102
78
|
end
|
103
79
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/apps/jobs/base'
|
4
|
+
require 'avm/eac_ubuntu_base0/apache'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacWebappBase0
|
9
|
+
class ApachePath
|
10
|
+
JOBS = %w[write_available_conf enable_conf reload_apache].freeze
|
11
|
+
include ::Avm::Apps::Jobs::Base
|
12
|
+
|
13
|
+
def content
|
14
|
+
::Avm::EacWebappBase0::ApachePath.template.child('default.conf').apply(variables_source)
|
15
|
+
end
|
16
|
+
|
17
|
+
def document_root
|
18
|
+
instance.read_entry(::Avm::Instances::EntryKeys::FS_PATH)
|
19
|
+
end
|
20
|
+
|
21
|
+
def extra_content
|
22
|
+
''
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def apache_uncached
|
28
|
+
::Avm::EacUbuntuBase0::Apache.new(instance.host_env)
|
29
|
+
end
|
30
|
+
|
31
|
+
def enable_conf
|
32
|
+
infom 'Enabling configuration...'
|
33
|
+
conf.enable
|
34
|
+
end
|
35
|
+
|
36
|
+
def reload_apache
|
37
|
+
infom 'Reloading Apache...'
|
38
|
+
apache.service('reload')
|
39
|
+
end
|
40
|
+
|
41
|
+
def conf_uncached
|
42
|
+
apache.conf(instance.id)
|
43
|
+
end
|
44
|
+
|
45
|
+
def write_available_conf
|
46
|
+
infom 'Writing available configuration...'
|
47
|
+
conf.write(content)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/callbacks'
|
4
|
+
require 'avm/apps/jobs/base'
|
4
5
|
require 'avm/git'
|
5
6
|
require 'avm/patches/object/template'
|
6
7
|
require 'eac_ruby_utils/core_ext'
|
@@ -11,24 +12,23 @@ module Avm
|
|
11
12
|
module EacWebappBase0
|
12
13
|
class Deploy
|
13
14
|
require_sub __FILE__, include_modules: true
|
14
|
-
include ::ActiveSupport::Callbacks
|
15
15
|
|
16
16
|
DEFAULT_REFERENCE = 'HEAD'
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
REQUEST_TEST_JOB = 'request_test'
|
19
|
+
JOBS = (%w[create_build_dir build_content append_instance_content write_on_target
|
20
|
+
setup_files_units assert_instance_branch] + [REQUEST_TEST_JOB]).freeze
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
include ::Avm::Apps::Jobs::Base
|
23
|
+
|
24
|
+
lists.add_symbol :option, :appended_directories, :no_request_test, :reference
|
25
|
+
|
26
|
+
def option_list
|
27
|
+
::Avm::EacWebappBase0::Deploy.lists.option
|
28
|
+
end
|
25
29
|
|
26
30
|
def run
|
27
|
-
|
28
|
-
run_jobs
|
29
|
-
::Avm::Result.success('Deployed')
|
30
|
-
rescue ::Avm::Result::Error => e
|
31
|
-
e.to_result
|
31
|
+
super
|
32
32
|
ensure
|
33
33
|
remove_build_dir
|
34
34
|
end
|
@@ -61,18 +61,12 @@ module Avm
|
|
61
61
|
fatal_error "Request to #{uri} failed" unless response.code.to_i == 200
|
62
62
|
end
|
63
63
|
|
64
|
-
|
65
|
-
instance
|
66
|
-
end
|
67
|
-
|
68
|
-
private
|
64
|
+
protected
|
69
65
|
|
70
|
-
def
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
75
|
-
end
|
66
|
+
def jobs
|
67
|
+
r = super
|
68
|
+
r.delete(REQUEST_TEST_JOB) if options[OPTION_NO_REQUEST_TEST]
|
69
|
+
r
|
76
70
|
end
|
77
71
|
end
|
78
72
|
end
|
@@ -1,22 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require '
|
3
|
+
require 'avm/instances/runner'
|
4
|
+
require 'eac_cli/core_ext'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module EacWebappBase0
|
8
8
|
class Runner < ::Avm::Instances::Runner
|
9
|
-
class ApacheHost
|
10
|
-
|
11
|
-
|
12
|
-
runner_definition do
|
9
|
+
class ApacheHost
|
10
|
+
runner_with :help do
|
13
11
|
desc 'Configure Apache virtual host for instance.'
|
14
12
|
bool_opt '-c', '--certbot', 'Install certbot.'
|
15
13
|
end
|
16
14
|
|
17
15
|
def run
|
18
|
-
|
19
|
-
result = stereotype_apache_host_class.new(context(:instance),
|
16
|
+
result = stereotype_apache_host_class.new(runner_context.call(:instance),
|
20
17
|
stereotype_apache_host_options).run
|
21
18
|
if result.error?
|
22
19
|
fatal_error result.to_s
|
@@ -26,11 +23,11 @@ module Avm
|
|
26
23
|
end
|
27
24
|
|
28
25
|
def stereotype_apache_host_class
|
29
|
-
"#{
|
26
|
+
"#{runner_context.call(:instance).class.name.deconstantize}::ApacheHost".constantize
|
30
27
|
end
|
31
28
|
|
32
29
|
def stereotype_apache_host_options
|
33
|
-
{ certbot:
|
30
|
+
{ certbot: parsed.certbot? }
|
34
31
|
end
|
35
32
|
end
|
36
33
|
end
|