Deploying with Capistrano via a gateway – some notes

In: Ruby|Ruby on Rails

15 May 2008

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 Responses to Deploying with Capistrano via a gateway – some notes

Avatar

A Fresh Cup » Blog Archive » Double Shot #208

May 15th, 2008 at 7pm

[...] 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. [...]

Avatar

Alan Harper

May 18th, 2008 at 12pm

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

Avatar

Double Shot #208 | Developer Home

May 24th, 2008 at 2am

[...] 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. [...]

Avatar

Confluence: Chicago Botanic Garden

June 25th, 2008 at 4am

PlantCollections Deployment (using Capistrano)…

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