Class: Krane::CLI::Krane

Inherits:
Thor
  • Object
show all
Defined in:
lib/krane/cli/krane.rb

Constant Summary collapse

TIMEOUT_EXIT_CODE =
70
FAILURE_EXIT_CODE =
1

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/krane/cli/krane.rb', line 70

def self.exit_on_failure?
  true
end

.expand_options(task_options) ⇒ Object



20
21
22
# File 'lib/krane/cli/krane.rb', line 20

def self.expand_options(task_options)
  task_options.each { |option_name, config| method_option(option_name, config) }
end

Instance Method Details

#deploy(namespace, context) ⇒ Object



56
57
58
59
60
# File 'lib/krane/cli/krane.rb', line 56

def deploy(namespace, context)
  rescue_and_exit do
    DeployCommand.from_options(namespace, context, options)
  end
end

#global_deploy(context) ⇒ Object



64
65
66
67
68
# File 'lib/krane/cli/krane.rb', line 64

def global_deploy(context)
  rescue_and_exit do
    GlobalDeployCommand.from_options(context, options)
  end
end

#renderObject



26
27
28
29
30
# File 'lib/krane/cli/krane.rb', line 26

def render
  rescue_and_exit do
    RenderCommand.from_options(options)
  end
end

#restart(namespace, context) ⇒ Object



40
41
42
43
44
# File 'lib/krane/cli/krane.rb', line 40

def restart(namespace, context)
  rescue_and_exit do
    RestartCommand.from_options(namespace, context, options)
  end
end

#run_command(namespace, context) ⇒ Object



48
49
50
51
52
# File 'lib/krane/cli/krane.rb', line 48

def run_command(namespace, context)
  rescue_and_exit do
    RunCommand.from_options(namespace, context, options)
  end
end

#versionObject



34
35
36
# File 'lib/krane/cli/krane.rb', line 34

def version
  VersionCommand.from_options(options)
end