Class: DockerDeploy::RemoteStage

Inherits:
Stage
  • Object
show all
Includes:
SSHKit::DSL
Defined in:
lib/docker_deploy/remote_stage.rb

Instance Attribute Summary

Attributes inherited from Stage

#container, #deploy, #env_files, #links, #name, #servers, #services, #variables

Instance Method Summary collapse

Methods inherited from Stage

#env, #env_file, #host, #link, #link_mappings, #options, #port, #port_mappings, #service

Constructor Details

#initialize(context, name) ⇒ RemoteStage

Returns a new instance of RemoteStage.



5
6
7
8
# File 'lib/docker_deploy/remote_stage.rb', line 5

def initialize(context, name)
  super
  @servers = []
end

Instance Method Details

#run(cmd) ⇒ Object



14
15
16
17
18
# File 'lib/docker_deploy/remote_stage.rb', line 14

def run(cmd)
  on servers do
    execute(cmd)
  end
end

#server(server) ⇒ Object



10
11
12
# File 'lib/docker_deploy/remote_stage.rb', line 10

def server(server)
  @servers << SSHKit::Host.new(server)
end

#shell(cmd = nil) ⇒ Object



20
21
22
# File 'lib/docker_deploy/remote_stage.rb', line 20

def shell(cmd = nil)
  DockerDeploy.shell(servers.first, cmd)
end