avm-tools 0.66.0 → 0.69.2
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_rails_base0/apache_host.rb +17 -0
- data/lib/avm/eac_rails_base0/deploy.rb +50 -0
- data/lib/avm/eac_rails_base0/instance.rb +14 -0
- data/lib/avm/eac_redmine_base0/deploy.rb +2 -2
- data/lib/avm/eac_redmine_base0/instance.rb +2 -2
- data/lib/avm/eac_webapp_base0/apache_host.rb +103 -0
- data/lib/avm/eac_webapp_base0/deploy.rb +102 -0
- data/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
- data/lib/avm/eac_webapp_base0/deploy/file_unit.rb +41 -0
- data/lib/avm/eac_webapp_base0/deploy/git_info.rb +49 -0
- data/lib/avm/eac_webapp_base0/deploy/version.rb +20 -0
- data/lib/avm/eac_webapp_base0/instance.rb +50 -0
- data/lib/avm/eac_webapp_base0/runner/apache_host.rb +39 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +25 -0
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +69 -0
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +66 -0
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +59 -0
- data/lib/avm/git/issue/complete/_git_subrepos.rb +1 -0
- data/lib/avm/instances/configuration/_locale.rb +16 -0
- data/lib/avm/local_projects/instance.rb +20 -1
- data/lib/avm/patches/i18n.rb +22 -0
- data/lib/avm/patches/object/i18n.rb +17 -0
- data/lib/avm/projects/stereotype.rb +1 -0
- data/lib/avm/projects/stereotypes/git_subrepo/warp.rb +2 -2
- data/lib/avm/projects/stereotypes/rails_application.rb +2 -0
- data/lib/avm/projects/stereotypes/rails_application/local_project_mixin.rb +18 -0
- data/lib/avm/projects/stereotypes/rails_application/update.rb +14 -0
- data/lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb +9 -0
- data/lib/avm/projects/stereotypes/ruby_gem/version_bump.rb +61 -0
- data/lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb +2 -2
- data/lib/avm/stereotypes/eac_wordpress_base0/deploy.rb +2 -2
- data/lib/avm/stereotypes/eac_wordpress_base0/instance.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0/apache_host.rb +3 -26
- data/lib/avm/tools/runner/eac_rails_base0/data.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0/deploy.rb +3 -3
- data/lib/avm/tools/runner/eac_redmine_base0/data.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +2 -2
- data/lib/avm/tools/runner/eac_redmine_base0/deploy.rb +2 -2
- data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +1 -0
- data/lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb +3 -25
- data/lib/avm/tools/runner/eac_wordpress_base0/data.rb +2 -2
- data/lib/avm/tools/runner/eac_wordpress_base0/deploy.rb +2 -2
- data/lib/avm/tools/runner/local_project/update.rb +1 -2
- data/lib/avm/tools/runner/local_project/version_bump.rb +89 -0
- data/lib/avm/tools/version.rb +1 -1
- data/lib/avm/version.rb +45 -0
- data/lib/eac_launcher/git/sub_warp_base.rb +1 -1
- data/lib/eac_launcher/publish/base.rb +1 -1
- data/template/avm/{stereotypes/eac_rails_base0 → eac_rails_base0}/deploy/config/database.yml.template +0 -0
- data/template/avm/{stereotypes/eac_webapp_base0 → eac_webapp_base0}/apache_host/no_ssl.conf +0 -0
- data/template/avm/self/docker_image/Dockerfile +1 -1
- data/vendor/eac_cli/Gemfile +5 -0
- data/vendor/eac_cli/eac_cli.gemspec +18 -0
- data/vendor/eac_cli/lib/eac_cli.rb +7 -0
- data/vendor/eac_cli/lib/eac_cli/default_runner.rb +14 -0
- data/vendor/eac_cli/lib/eac_cli/definition.rb +72 -0
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -0
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +27 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +77 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +45 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +14 -0
- data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +56 -0
- data/vendor/eac_cli/lib/eac_cli/parser/error.rb +15 -0
- data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +105 -0
- data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +21 -0
- data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +49 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +87 -0
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +18 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with.rb +9 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +19 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +26 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +5 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +70 -0
- data/vendor/eac_cli/spec/rubocop_spec.rb +7 -0
- data/vendor/eac_cli/spec/spec_helper.rb +100 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +3 -3
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +5 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +15 -1
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +41 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +5 -34
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +42 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +25 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +14 -0
- data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +7 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +4 -4
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +6 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +8 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +9 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +6 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +53 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +15 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +46 -0
- metadata +65 -19
- data/lib/avm/local_projects/jobs/update.rb +0 -29
- data/lib/avm/stereotypes/eac_rails_base0/apache_host.rb +0 -19
- data/lib/avm/stereotypes/eac_rails_base0/deploy.rb +0 -52
- data/lib/avm/stereotypes/eac_rails_base0/instance.rb +0 -16
- data/lib/avm/stereotypes/eac_webapp_base0/apache_host.rb +0 -97
- data/lib/avm/stereotypes/eac_webapp_base0/deploy.rb +0 -104
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/appended_directories.rb +0 -27
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb +0 -43
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/git_info.rb +0 -51
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/version.rb +0 -22
- data/lib/avm/stereotypes/eac_webapp_base0/instance.rb +0 -52
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data.rb +0 -27
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data/dump.rb +0 -71
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data/load.rb +0 -68
- data/lib/avm/stereotypes/eac_webapp_base0/runner/deploy.rb +0 -61
@@ -32,7 +32,7 @@ module Avm
|
|
32
32
|
return if parent_git_warped.rev_parse(subrepo_parent_hash) &&
|
33
33
|
parent_git_warped.descendant?('HEAD', subrepo_parent_hash)
|
34
34
|
|
35
|
-
raise
|
35
|
+
raise Avm::Launcher::Errors::Base,
|
36
36
|
"Subrepo parent hash \"#{subrepo_parent_hash}\"" \
|
37
37
|
" not found in \"#{parent_git_warped}\""
|
38
38
|
end
|
@@ -42,7 +42,7 @@ module Avm
|
|
42
42
|
h = data['Pull Parent']
|
43
43
|
return h if h.present?
|
44
44
|
|
45
|
-
raise
|
45
|
+
raise Avm::Launcher::Errors::Base, "Subrepo parent hash is blank: #{data}"
|
46
46
|
end
|
47
47
|
|
48
48
|
def init_aux
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/projects/stereotype'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module Avm
|
6
7
|
module Projects
|
7
8
|
module Stereotypes
|
8
9
|
class RailsApplication
|
10
|
+
require_sub __FILE__
|
9
11
|
include Avm::Projects::Stereotype
|
10
12
|
|
11
13
|
class << self
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/projects/stereotypes/ruby_gem/local_project_mixin'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Projects
|
8
|
+
module Stereotypes
|
9
|
+
class RailsApplication
|
10
|
+
module LocalProjectMixin
|
11
|
+
common_concern do
|
12
|
+
include ::Avm::Projects::Stereotypes::RubyGem::LocalProjectMixin
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/projects/stereotypes/ruby_gem/update'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Projects
|
7
|
+
module Stereotypes
|
8
|
+
class RailsApplication
|
9
|
+
class Update < ::Avm::Projects::Stereotypes::RubyGem::Update
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/patches/eac_ruby_gems_utils/gem'
|
4
|
+
require 'avm/version'
|
4
5
|
require 'eac_ruby_utils/core_ext'
|
5
6
|
|
6
7
|
module Avm
|
@@ -12,6 +13,14 @@ module Avm
|
|
12
13
|
def ruby_gem
|
13
14
|
@ruby_gem ||= ::EacRubyGemsUtils::Gem.new(path)
|
14
15
|
end
|
16
|
+
|
17
|
+
def version
|
18
|
+
ruby_gem.version.if_present { |v| ::Avm::Version.new(v) }
|
19
|
+
end
|
20
|
+
|
21
|
+
def version=(value)
|
22
|
+
ruby_gem.version_file.value = value
|
23
|
+
end
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/patches/object/i18n'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Projects
|
8
|
+
module Stereotypes
|
9
|
+
class RubyGem
|
10
|
+
class VersionBump
|
11
|
+
enable_console_speaker
|
12
|
+
common_constructor :instance, :target_version
|
13
|
+
|
14
|
+
def run
|
15
|
+
git_checkout
|
16
|
+
change_version
|
17
|
+
bundle_run
|
18
|
+
git_commit
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def bundle_run
|
24
|
+
infom 'Running "bundle install"...'
|
25
|
+
instance.ruby_gem.bundle('install').execute!
|
26
|
+
end
|
27
|
+
|
28
|
+
def change_version
|
29
|
+
infom 'Setting project version...'
|
30
|
+
instance.version = target_version
|
31
|
+
end
|
32
|
+
|
33
|
+
def git_checkout
|
34
|
+
return unless instance.respond_to?(:git_repo)
|
35
|
+
|
36
|
+
infom "Checkouting #{changing_files.map(&:to_path).join(', ')}..."
|
37
|
+
instance.git_repo.command('checkout', '--',
|
38
|
+
*changing_files.map(&:to_path)).execute!
|
39
|
+
end
|
40
|
+
|
41
|
+
def git_commit
|
42
|
+
return unless instance.respond_to?(:git_repo)
|
43
|
+
|
44
|
+
infom "Commiting #{changing_files.map(&:to_path).join(', ')}..."
|
45
|
+
instance.git_repo.command('commit', '-m', git_commit_message, '--',
|
46
|
+
*changing_files.map(&:to_path)).execute!
|
47
|
+
end
|
48
|
+
|
49
|
+
def git_commit_message
|
50
|
+
::I18n.default_locale = instance.locale
|
51
|
+
translate(__method__, version: target_version)
|
52
|
+
end
|
53
|
+
|
54
|
+
def changing_files
|
55
|
+
[instance.ruby_gem.gemfile_lock_path, instance.ruby_gem.version_file_path]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/apache_host'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Stereotypes
|
7
7
|
module EacWordpressBase0
|
8
|
-
class ApacheHost < ::Avm::
|
8
|
+
class ApacheHost < ::Avm::EacWebappBase0::ApacheHost
|
9
9
|
def document_root
|
10
10
|
instance.read_entry(:fs_path)
|
11
11
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/deploy'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Stereotypes
|
7
7
|
module EacWordpressBase0
|
8
|
-
class Deploy < ::Avm::
|
8
|
+
class Deploy < ::Avm::EacWebappBase0::Deploy
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/instances/entry_keys'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/eac_webapp_base0/instance'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Stereotypes
|
8
8
|
module EacWordpressBase0
|
9
|
-
class Instance < ::Avm::
|
9
|
+
class Instance < ::Avm::EacWebappBase0::Instance
|
10
10
|
FILES_UNITS = { uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze
|
11
11
|
|
12
12
|
def database_unit
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/console/docopt_runner'
|
4
4
|
require 'eac_ruby_utils/simple_cache'
|
5
|
-
require 'avm/
|
5
|
+
require 'avm/eac_rails_base0/instance'
|
6
6
|
require 'eac_ruby_utils/require_sub'
|
7
7
|
::EacRubyUtils.require_sub(__FILE__)
|
8
8
|
|
@@ -26,7 +26,7 @@ module Avm
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def instance_uncached
|
29
|
-
::Avm::
|
29
|
+
::Avm::EacRailsBase0::Instance.by_id(options['<instance_id>'])
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,37 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/eac_webapp_base0/runner/apache_host'
|
3
4
|
require 'eac_ruby_utils/console/docopt_runner'
|
4
|
-
require '
|
5
|
-
require 'avm/stereotypes/eac_rails_base0/apache_host'
|
5
|
+
require 'avm/eac_rails_base0/apache_host'
|
6
6
|
|
7
7
|
module Avm
|
8
8
|
module Tools
|
9
9
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
10
|
class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
|
11
|
-
class ApacheHost < ::
|
12
|
-
include ::EacRubyUtils::Console::Speaker
|
13
|
-
|
14
|
-
DOC = <<~DOCOPT
|
15
|
-
Deploy for EacRailsBase0 instance.
|
16
|
-
|
17
|
-
Usage:
|
18
|
-
__PROGRAM__ [options]
|
19
|
-
__PROGRAM__ -h | --help
|
20
|
-
|
21
|
-
Options:
|
22
|
-
-h --help Show this screen.
|
23
|
-
DOCOPT
|
24
|
-
|
25
|
-
def run
|
26
|
-
result = ::Avm::Stereotypes::EacRailsBase0::ApacheHost.new(
|
27
|
-
context(:instance)
|
28
|
-
).run
|
29
|
-
if result.error?
|
30
|
-
fatal_error result.to_s
|
31
|
-
else
|
32
|
-
infov 'Result', result.label
|
33
|
-
end
|
34
|
-
end
|
11
|
+
class ApacheHost < ::Avm::EacWebappBase0::Runner::ApacheHost
|
35
12
|
end
|
36
13
|
end
|
37
14
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/runner/data'
|
4
4
|
require 'eac_ruby_utils/console/docopt_runner'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
8
8
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Data < ::Avm::
|
10
|
+
class Data < ::Avm::EacWebappBase0::Runner::Data
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
4
|
-
require 'avm/
|
3
|
+
require 'avm/eac_rails_base0/deploy'
|
4
|
+
require 'avm/eac_webapp_base0/runner/deploy'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
8
8
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class EacRailsBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Deploy < ::Avm::
|
10
|
+
class Deploy < ::Avm::EacWebappBase0::Runner::Deploy
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/runner/data/dump'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Tools
|
7
7
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
8
8
|
class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class Data < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Dump < ::Avm::
|
10
|
+
class Dump < ::Avm::EacWebappBase0::Runner::Data::Dump
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_redmine_base0/deploy'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/eac_webapp_base0/runner/deploy'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
8
8
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Deploy < ::Avm::
|
10
|
+
class Deploy < ::Avm::EacWebappBase0::Runner::Deploy
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,37 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/eac_webapp_base0/runner/apache_host'
|
4
|
+
require 'eac_cli/default_runner'
|
3
5
|
require 'eac_ruby_utils/console/docopt_runner'
|
4
|
-
require 'eac_ruby_utils/console/speaker'
|
5
6
|
require 'avm/stereotypes/eac_wordpress_base0/apache_host'
|
6
7
|
|
7
8
|
module Avm
|
8
9
|
module Tools
|
9
10
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
11
|
class EacWordpressBase0 < ::EacRubyUtils::Console::DocoptRunner
|
11
|
-
class ApacheHost < ::
|
12
|
-
include ::EacRubyUtils::Console::Speaker
|
13
|
-
|
14
|
-
DOC = <<~DOCOPT
|
15
|
-
Configure Apache virtual host for EacWordpressBase0 instance.
|
16
|
-
|
17
|
-
Usage:
|
18
|
-
__PROGRAM__ [options]
|
19
|
-
__PROGRAM__ -h | --help
|
20
|
-
|
21
|
-
Options:
|
22
|
-
-h --help Show this screen.
|
23
|
-
DOCOPT
|
24
|
-
|
25
|
-
def run
|
26
|
-
result = ::Avm::Stereotypes::EacWordpressBase0::ApacheHost.new(
|
27
|
-
context(:instance)
|
28
|
-
).run
|
29
|
-
if result.error?
|
30
|
-
fatal_error result.to_s
|
31
|
-
else
|
32
|
-
infov 'Result', result.label
|
33
|
-
end
|
34
|
-
end
|
12
|
+
class ApacheHost < ::Avm::EacWebappBase0::Runner::ApacheHost
|
35
13
|
end
|
36
14
|
end
|
37
15
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/runner/data'
|
4
4
|
require 'eac_ruby_utils/console/docopt_runner'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
8
8
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class EacWordpressBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Data < ::Avm::
|
10
|
+
class Data < ::Avm::EacWebappBase0::Runner::Data
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_webapp_base0/runner/deploy'
|
4
4
|
require 'avm/stereotypes/eac_wordpress_base0/deploy'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
8
8
|
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
9
|
class EacWordpressBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
-
class Deploy < ::Avm::
|
10
|
+
class Deploy < ::Avm::EacWebappBase0::Runner::Deploy
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/local_projects/jobs/update'
|
4
3
|
require 'eac_ruby_utils/console/docopt_runner'
|
5
4
|
require 'eac_ruby_utils/core_ext'
|
6
5
|
|
@@ -17,7 +16,7 @@ module Avm
|
|
17
16
|
|
18
17
|
def run
|
19
18
|
infov 'Path', context(:instance).path
|
20
|
-
|
19
|
+
context(:instance).run_job(:update)
|
21
20
|
end
|
22
21
|
end
|
23
22
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/version'
|
4
|
+
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Tools
|
9
|
+
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
10
|
+
class LocalProject < ::EacRubyUtils::Console::DocoptRunner
|
11
|
+
class VersionBump < ::EacRubyUtils::Console::DocoptRunner
|
12
|
+
include ::EacCli::DefaultRunner
|
13
|
+
|
14
|
+
runner_definition do
|
15
|
+
desc 'Bump version of a local project.'
|
16
|
+
arg_opt '-n', '--new', 'Set new version.'
|
17
|
+
arg_opt '-s', '--segment', 'Increment de <segment>-th segment (Left-most is 0)'
|
18
|
+
bool_opt '-M', '--major', 'Same as --segment=0.'
|
19
|
+
bool_opt '-m', '--minor', 'Same as --segment=1.'
|
20
|
+
bool_opt '-p', '--patch', 'Same as --segment=2.'
|
21
|
+
bool_opt '-y', '--yes', 'Bump without confirmation.'
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
start_banner
|
26
|
+
version_changed? ? run_version_changed : run_version_unchanged
|
27
|
+
end
|
28
|
+
|
29
|
+
def run_version_changed
|
30
|
+
infom 'Version changed'
|
31
|
+
if confirm?
|
32
|
+
context(:instance).run_job(:version_bump, target_version)
|
33
|
+
success 'Bumped'
|
34
|
+
else
|
35
|
+
fatal_error 'Bump unconfirmed'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def run_version_unchanged
|
40
|
+
success 'Version unchanged'
|
41
|
+
end
|
42
|
+
|
43
|
+
def start_banner
|
44
|
+
context(:instance_banner)
|
45
|
+
infov 'Current version', current_version.if_present('-')
|
46
|
+
infov 'Target version', target_version.if_present('-')
|
47
|
+
end
|
48
|
+
|
49
|
+
def confirm?
|
50
|
+
options.fetch('--yes') || request_input('Confirm version bump?', bool: true)
|
51
|
+
end
|
52
|
+
|
53
|
+
def current_version_uncached
|
54
|
+
context(:instance).if_respond('version')
|
55
|
+
end
|
56
|
+
|
57
|
+
def target_version_uncached
|
58
|
+
r = current_version
|
59
|
+
%w[new segment major minor patch].each do |option|
|
60
|
+
option_value = options.fetch("--#{option}")
|
61
|
+
next if option_value.blank?
|
62
|
+
|
63
|
+
r = send("target_version_from_#{option}", r, option_value)
|
64
|
+
end
|
65
|
+
r
|
66
|
+
end
|
67
|
+
|
68
|
+
def target_version_from_new(_current, option_value)
|
69
|
+
::Avm::Version.new(option_value)
|
70
|
+
end
|
71
|
+
|
72
|
+
def target_version_from_segment(current, option_value)
|
73
|
+
current.increment_segment(option_value.to_i)
|
74
|
+
end
|
75
|
+
|
76
|
+
%w[major minor patch].each_with_index do |segment, segment_index|
|
77
|
+
define_method "target_version_from_#{segment}" do |current, _option_value|
|
78
|
+
target_version_from_segment(current, segment_index)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def version_changed?
|
83
|
+
target_version != current_version
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|