Sha256: a5862ec969e7eada42ced4ae97faa290898428e7743b1f3e63353a5d875448f8

Contents?: true

Size: 1.29 KB

Versions: 18

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require 'avm/instances/runner'
require 'avm/path_string'
require 'eac_ruby_utils/console/docopt_runner'
require 'eac_ruby_utils/console/speaker'

module Avm
  module EacWebappBase0
    class Runner < ::Avm::Instances::Runner
      class Deploy < ::EacRubyUtils::Console::DocoptRunner
        include ::EacRubyUtils::Console::Speaker

        DOC = <<~DOCOPT
          Deploy for instance.

          Usage:
            __PROGRAM__ [options]
            __PROGRAM__ -h | --help

          Options:
            -h --help                       Show this screen.
            -r --reference=<git-reference>  Git reference to deploy.
            -a --append-dirs=<append-dirs>  Append directories to deploy (List separated by ":").
        DOCOPT

        def deploy_class
          context(:stereotype_module).const_get('Deploy')
        end

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

        def deploy_options
          { reference: options.fetch('--reference'),
            appended_directories: ::Avm::PathString.paths(options.fetch('--append-dirs')) }
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
avm-tools-0.88.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.87.1 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.87.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.86.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.85.1 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.85.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.84.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.83.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.82.1 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.82.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.81.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.80.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.79.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.78.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.77.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.76.1 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.76.0 lib/avm/eac_webapp_base0/runner/deploy.rb
avm-tools-0.75.1 lib/avm/eac_webapp_base0/runner/deploy.rb