Created
January 25, 2014 00:08
-
-
Save halkeye/8609506 to your computer and use it in GitHub Desktop.
For production Capistrano deploys, we can't use our own internal git server because the one off amazon box doesn't have access to the internal network. Hacked in a solution to create a port forward to talk back to our network. Works in this case so sharing.
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
set :repo_url, "ssh://git@localhost:9000/#{fetch(:application)}.git" | |
module SSHKit; module Backend | |
class Netssh < Printer | |
alias_method :orig_ssh, :ssh | |
def ssh | |
ret = orig_ssh | |
@@created_remote ||= ret.forward.remote(22, 'gitserver', 9000) | |
return ret | |
end | |
end | |
end; end | |
server 'amazonserver.amazonaws.com', roles: %w{app web db}, user: 'ec2-user' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I keep getting this error:
cap aborted!
undefined method 'ssh' for class 'SSHKit::Backend::Netssh'
config/deploy/production.rb:5:in 'alias_method'
Do you have any clue?