Class: PsRemoveCommand

Inherits:
Command show all
Defined in:
lib/ukku/ps_remove_command.rb

Instance Method Summary collapse

Methods inherited from Command

#load_app_info

Instance Method Details

#execute(args) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ukku/ps_remove_command.rb', line 2

def execute(args)
  type = args['TYPE']

  app_info = load_app_info(args)

  puts "Removing process type '#{type}' on #{app_info[:host]} ..."
  conn = Connection.new(app_info)
  begin
    conn.execute("sudo rm /etc/ukku/ps-types/#{type} && docker kill app-#{type} && docker rm app-#{type}")
    conn.execute("launchapp")
  rescue Subprocess::NonZeroExit => e
  end
end