Class: Dip::CLI::SSH

Inherits:
Base
  • Object
show all
Defined in:
lib/dip/cli/ssh.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Instance Method Details

#downObject



42
43
44
45
46
47
48
# File 'lib/dip/cli/ssh.rb', line 42

def down
  if options[:help]
    invoke :help, ["down"]
  else
    Dip::Commands::SSH::Down.new.execute
  end
end

#restart(*args) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/dip/cli/ssh.rb', line 53

def restart(*args)
  if options[:help]
    invoke :help, ["restart"]
  else
    Dip::CLI::SSH.start(["down"] + args)
    sleep 1
    Dip::CLI::SSH.start(["up"] + args)
  end
end

#statusObject



66
67
68
69
70
71
72
# File 'lib/dip/cli/ssh.rb', line 66

def status
  if options[:help]
    invoke :help, ["status"]
  else
    Dip::Commands::SSH::Status.new.execute
  end
end

#upObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/dip/cli/ssh.rb', line 24

def up
  if options[:help]
    invoke :help, ["up"]
  else
    Dip::Commands::SSH::Up.new(
      key: options.fetch(:key),
      volume: options.fetch(:volume),
      interactive: options.nonteractive? ? false : options.interactive?,
      user: options.user
    ).execute
  end
end