Class: Aerosol::SshCommand

Inherits:
AbstractCommand show all
Defined in:
lib/aerosol/cli.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/aerosol/cli.rb', line 35

def execute
  super
  if deploy = Aerosol.deploy(deploy_name.to_sym)
    ssh_commands = deploy.generate_ssh_commands
    raise 'No instances to ssh too!' if ssh_commands.empty?

    ssh_commands.each do |ssh_command|
      puts ssh_command
    end

    if run_first?
      system(ssh_commands.first)
    end
  end
end