Run Script/console Remotely With Capistrano
Join the DZone community and get the full member experience.
Join For FreeFrom http://errtheblog.com/post/21.
Allows you to execute script/console remotely through Capistrano. Not for use on multi-machine :roles.
desc "remotely console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/
end
end
Capistrano (software)
Opinions expressed by DZone contributors are their own.
Comments