Deploying with Capistrano

Deploying with Capistrano

The Assembla Build Agent currently uses Capistrano for deployment. Here are steps to configure an application for deploying with Capistrano and Build Tool:

  1. Capify your project
  2. Set your Capistrano configuration variables in config/deploy.rb:

Some Capistrano configuration variables can be retrieved from the environment; just remember to load the configuration file of the project before this in the script that will run Capistrano tasks:

If you want to use same Capistrano config for stage and for production by example, where you may have different host, user, deploy_to or other settings, you may use ENV[‘STAGE’] variable to identify which target is running now, by example:

if ENV['STAGE']
  #. stage options 
  set :host, "localhost"
  set :user, "deploy"
  set :deploy_to, "/opt/apps/#{application}"
else
  #. production options
  set :host, "my.production.host"
  set :user, "root"
end