Module: Armada::Commands

Defined in:
lib/armada/utils/commands.rb

Class Method Summary collapse

Class Method Details

.stop(project, environment, options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/armada/utils/commands.rb', line 4

def self.stop(project, environment, options)
  options = Armada::Configuration.load!(project, environment, options)
  begin
    options[:hosts].each_in_parallel do |host|
      Armada.ui.info "Stopping container named [#{options[:container_name]}] on #{host}"
      docker_host = Armada::Host.create(host, options)
      container = Armada::Container.new(nil, docker_host, options)
      container.stop
    end
  rescue Exception => e
    Armada.ui.error "#{e.message} \n\n #{e.backtrace.join("\n")}"
    exit(1)
  end
end