Class: Kitchen::CLI

Inherits:
Thor
  • Object
show all
Includes:
PerformCommand, Logging
Defined in:
lib/kitchen/cli.rb

Overview

The command line runner for Kitchen.

Author:

Defined Under Namespace

Modules: PerformCommand Classes: Driver

Constant Summary collapse

MAX_CONCURRENCY =

The maximum number of concurrent instances that can run--which is a bit high

9999

Instance Method Summary collapse

Methods included from PerformCommand

#perform

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Constructor Details

#initialize(*args) ⇒ CLI

Constructs a new instance.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/kitchen/cli.rb', line 68

def initialize(*args)
  super
  $stdout.sync = true
  Kitchen.logger = Kitchen.default_file_logger
  @loader = Kitchen::Loader::YAML.new(
    :project_config => ENV["KITCHEN_YAML"],
    :local_config => ENV["KITCHEN_LOCAL_YAML"],
    :global_config => ENV["KITCHEN_GLOBAL_YAML"]
  )
  @config = Kitchen::Config.new(
    :loader     => @loader,
    :log_level  => ENV.fetch("KITCHEN_LOG", "info").downcase.to_sym
  )
end

Instance Method Details

#consoleObject



246
247
248
# File 'lib/kitchen/cli.rb', line 246

def console
  perform("console", "console")
end

#diagnose(*args) ⇒ Object



114
115
116
117
# File 'lib/kitchen/cli.rb', line 114

def diagnose(*args)
  update_config!
  perform("diagnose", "diagnose", args, :loader => @loader)
end

#exec(*args) ⇒ Object



229
230
231
232
# File 'lib/kitchen/cli.rb', line 229

def exec(*args)
  update_config!
  perform("exec", "exec", args)
end

#list(*args) ⇒ Object



95
96
97
98
# File 'lib/kitchen/cli.rb', line 95

def list(*args)
  update_config!
  perform("list", "list", args)
end

#login(*args) ⇒ Object



216
217
218
219
# File 'lib/kitchen/cli.rb', line 216

def (*args)
  update_config!
  perform("login", "login", args)
end

#sinkObject



241
242
243
# File 'lib/kitchen/cli.rb', line 241

def sink
  perform("sink", "sink")
end

#test(*args) ⇒ Object



206
207
208
209
210
# File 'lib/kitchen/cli.rb', line 206

def test(*args)
  update_config!
  ensure_initialized
  perform("test", "test", args)
end

#versionObject



235
236
237
# File 'lib/kitchen/cli.rb', line 235

def version
  puts "Test Kitchen version #{Kitchen::VERSION}"
end