Deploying with Capistrano via a gateway – some notes
In: Ruby|Ruby on Rails
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, 'email@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, 'firstname.lastname@example.org'
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.