Sha256: 236ec5eafa7b65c61a3fcf58f8b6d073f53cbb34c8c4a7f8b2ca27ae0e1479bb

Contents?: true

Size: 1.03 KB

Versions: 24

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'eac_cli/default_runner'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacWebappBase0
    class Runner < ::Avm::Instances::Runner
      class ApacheHost < ::EacRubyUtils::Console::DocoptRunner
        include ::EacCli::DefaultRunner

        runner_definition do
          desc 'Configure Apache virtual host for instance.'
          bool_opt '-c', '--certbot', 'Install certbot.'
        end

        def run
          options
          result = stereotype_apache_host_class.new(context(:instance),
                                                    stereotype_apache_host_options).run
          if result.error?
            fatal_error result.to_s
          else
            infov 'Result', result.label
          end
        end

        def stereotype_apache_host_class
          "#{context(:instance).class.name.deconstantize}::ApacheHost".constantize
        end

        def stereotype_apache_host_options
          { certbot: options.fetch('--certbot') }
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
avm-tools-0.92.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.91.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.90.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.89.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.88.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.87.1 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.87.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.86.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.85.1 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.85.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.84.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.83.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.82.1 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.82.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.81.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.80.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.79.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.78.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.77.0 lib/avm/eac_webapp_base0/runner/apache_host.rb
avm-tools-0.76.1 lib/avm/eac_webapp_base0/runner/apache_host.rb