Class: Capistrano::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/forwarding/remote.rb

Instance Method Summary collapse

Instance Method Details

#remote_forwarding(fowardings, options = {}) ⇒ Object

Capistrano configuration example. Forwarding remote port 3000 to local 3000 and ask remote hosts to HTTP GET from local HTTP server running on port 3000.

remote_forwarding [
  [3000, "127.0.0.1", 3000]
] do
  run "curl 'http://127.0.0.1:3000/'"
end


135
136
137
138
139
140
141
142
143
# File 'lib/capistrano/forwarding/remote.rb', line 135

def remote_forwarding(fowardings, options = {})
  options = add_default_command_options(options)
  execute_on_servers(options) do |servers|
    targets = servers.map{|s| sessions[s]}
    Forwarding::Remote.forward(fowardings, targets) do
      yield
    end
  end
end