Skip to content

Instantly share code, notes, and snippets.

@Tho85

Tho85/deploy.rb

Created Apr 30, 2013
Embed
What would you like to do?
# Start SSH session on first available server
task :ssh do
hostname = find_servers_for_task(current_task).first
exec %Q|ssh -l #{user} #{hostname} -t '#{default_shell}'|
end
# Start Rails console on first available server
namespace :rails do
task :console, :roles => :app do
hostname = find_servers_for_task(current_task).first
exec %Q|ssh -l #{user} -p #{ssh_options[:port] || 22} #{hostname} -t 'bash -l -c "cd #{current_path} && bundle exec rails console #{rails_env}"'|
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment