Deploying with Capistrano via a gateway - some notes

Some notes on setting up a gateway server for deploying via Capistrano that I couldn’t find at the source.

  • You can specify the user you want to use to login to your gateway server like so: set :gateway, 'deploy@deploy.example.com'. This logs in to your gateway server as the “deploy” user.
  • You can specify an alternate SSH port for both your gateway and your deployment servers. E.g. setting ssh_options[:port] = 11111 will make Capistrano SSH to your gateway server with on port 11111. For your actual application (and web and database) servers, you can specify the SSH port like so:
    set :gateway, 'deploy@deploy.example.com'
    role :app, '192.168.1.113:22222'
    role :web, '192.168.1.113:22222'
    role :db,  '192.168.1.113:22222', :primary => true
  • If you’re using public key authentication, you should put the public keys of your users (those who be deploying your app) on the gateway server and on the actual servers. I thought Capistrano would use the key of the “deploy” user but nope.

4 Comments & TrackBacks ()

Paper doll icon
A Fresh Cup » Blog Archive » Double Shot #208's Gravatar

[…] Deploying with Capistrano via a gateway - Chu Yeow sorts a few things out. I have one project where this would be useful, except that they are stuck on an older Capistrano due to inertia. […]

Posted by: A Fresh Cup » Blog Archive » Double Shot #208 on May 15, 2008 7pm

Paper doll icon
Alan Harper's Gravatar

You can edit your .ssh/config and allow Authentication Forwarding to remote machines, and then no ssh key copying is required. BIG FAT SECURITY NOTE a superuser on the gateway machine could attack your session and use your key elsewhere

Posted by: Alan Harper on May 18, 2008 12pm

Paper doll icon
Double Shot #208 | Developer Home's Gravatar

[…] Deploying with Capistrano via a gateway - Chu Yeow sorts a few things out. I have one project where this would be useful, except that they are stuck on an older Capistrano due to inertia. […]

Posted by: Double Shot #208 | Developer Home on May 24, 2008 2am

Paper doll icon
Confluence: Chicago Botanic Garden's Gravatar

PlantCollections Deployment (using Capistrano)…

System Requirements (on laptop where capistrano commands are executed) We need following plugins: gem install capistrano (version 2.4…….

Posted by: Confluence: Chicago Botanic Garden on June 25, 2008 4am

You can subscribe to the RSS feed for comments on this post.

Sorry, this entry is no longer accepting comments. If you have something you really want to say, you can write me.