Class: Kaiser::Cmds::Login

Inherits:
Kaiser::Cli show all
Defined in:
lib/kaiser/cmds/login.rb

Instance Attribute Summary

Attributes inherited from Kaiser::Cli

#use_kaiserfile

Instance Method Summary collapse

Methods inherited from Kaiser::Cli

all_subcommands_usage, #define_options, #initialize, register, run_command, #set_config, #start_services, #stop_app, #stop_services

Methods included from Kaiser::CliOptions

#option, #options

Constructor Details

This class inherits a constructor from Kaiser::Cli

Instance Method Details

#execute(_opts) ⇒ Object



14
15
16
17
18
# File 'lib/kaiser/cmds/login.rb', line 14

def execute(_opts)
  ensure_setup
  cmd = (ARGV || []).join(' ')
  exec "docker exec -ti #{app_container_name} #{cmd}"
end

#usageObject



6
7
8
9
10
11
12
# File 'lib/kaiser/cmds/login.rb', line 6

def usage
  <<~EOS
    Executes a command on the application docker container. By executing the command \`sh\` you can get a login shell.

    USAGE: kaiser login COMMAND
  EOS
end