Class: DockerDeploy::RemoteStage
- 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
-
#initialize(context, name) ⇒ RemoteStage
constructor
A new instance of RemoteStage.
- #run(cmd) ⇒ Object
- #server(server) ⇒ Object
- #shell(cmd = nil) ⇒ Object
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.
3 4 5 6 |
# File 'lib/docker_deploy/remote_stage.rb', line 3 def initialize(context, name) super @servers = [] end |
Instance Method Details
#run(cmd) ⇒ Object
12 13 14 15 16 |
# File 'lib/docker_deploy/remote_stage.rb', line 12 def run(cmd) on servers do execute(cmd) end end |
#server(server) ⇒ Object
8 9 10 |
# File 'lib/docker_deploy/remote_stage.rb', line 8 def server(server) @servers << SSHKit::Host.new(server) end |
#shell(cmd = nil) ⇒ Object
18 19 20 |
# File 'lib/docker_deploy/remote_stage.rb', line 18 def shell(cmd = nil) DockerDeploy.shell(servers.first, cmd) end |