Class: Dip::Commands::SSH::Up
- Inherits:
-
Dip::Command
- Object
- Dip::Command
- Dip::Commands::SSH::Up
- Defined in:
- lib/dip/commands/ssh.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(key:, volume:, interactive:) ⇒ Up
constructor
A new instance of Up.
Methods inherited from Dip::Command
Constructor Details
#initialize(key:, volume:, interactive:) ⇒ Up
Returns a new instance of Up.
10 11 12 13 14 |
# File 'lib/dip/commands/ssh.rb', line 10 def initialize(key:, volume:, interactive:) @key = key @volume = volume @interactive = interactive end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/dip/commands/ssh.rb', line 16 def execute subshell("docker", "volume create --name ssh_data".shellsplit, out: File::NULL, err: File::NULL) subshell("docker", "run --detach --volume ssh_data:/ssh --name=ssh-agent whilp/ssh-agent".shellsplit) key = Dip.env.interpolate(@key) subshell("docker", "run #{container_args} whilp/ssh-agent ssh-add #{key}".shellsplit) end |