Class: Kaiser::Cmds::Shutdown

Inherits:
Kaiser::Cli show all
Defined in:
lib/kaiser/cmds/shutdown.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



16
17
18
19
20
21
22
23
# File 'lib/kaiser/cmds/shutdown.rb', line 16

def execute(_opts)
  Config.config[:shared_names].each_value do |container_name|
    killrm container_name
  end

  CommandRunner.run Config.out, "docker network rm #{Config.config[:networkname]}"
  CommandRunner.run Config.out, "docker volume rm #{Config.config[:shared_names][:certs]}"
end

#usageObject



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

def usage
  # TODO: Explain a bit more about what these containers do and what shutting
  #      them down really means for an end user.
  "    Shuts down all the containers used internally by Kaiser.\n\n    USAGE: kaiser shutdown\n  EOS\nend\n"