Created
March 20, 2017 09:09
-
-
Save BitOfUniverse/bea1a05f13ccfc1b183b00a71d6d6ef5 to your computer and use it in GitHub Desktop.
SSH to capistrano server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/capistrano/tasks/ssh.rake | |
# | |
# Usage: cap staging ssh | |
desc 'Connects thru SSH to server' | |
task :ssh do | |
on roles(:app) do |server| | |
ssh_command = nil | |
with_props(server) do |host, user| | |
ssh_command = "ssh #{user}@#{host}" | |
end | |
exec ssh_command | |
end | |
end | |
def with_props(server) | |
yield server.hostname, server.user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment