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, #variables
Instance Method Summary collapse
-
#initialize(context, name) ⇒ RemoteStage
constructor
A new instance of RemoteStage.
- #run(cmd) ⇒ Object
- #run_once(cmd) ⇒ Object
- #server(server) ⇒ Object
Methods inherited from Stage
#env, #env_file, #host, #link, #link_mappings, #options, #port, #port_mappings
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 |
#run_once(cmd) ⇒ Object
18 19 20 21 22 |
# File 'lib/docker_deploy/remote_stage.rb', line 18 def run_once(cmd) on servers.first 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 |