Alternative Deployment Recipes

Once you are familiar with the basics of the Default Execution Path you may want to tailor this to your exact deployment requirements.

Typically if deploying a Rails application, you should only need to extend the default recipe using the before() and after() hooks; however when deploying applications built in Python, PHP, Merb, Perl, Sinatra, Kohana, Cake or any other technology, you may need a more tailored solution.

You may also want to look at Deploying to Multiple Stages.

Deploying Non-Rails Applications with Capistrano

When deploying non-rails applications with Capistrano, most people find that all they require is the transactional (rollback) and Railsless Deploys.

There are a few ways to remove the Railsisms from Capistrano, one is to run something like the following to neutralize the effect of all the existing rails tasks, that way you can easily redefine them to suit your own needs:

    namespace :deploy do
      [:setup, :update, :update_code, :finalize_update, :symlink, :restart].each do |default_task|
        task default_task do 
          # ... ahh, silence!
        end
      end
    end

The block above redefines all the tasks in the array defined on the 2nd line with a null declaration, without any instructions, these tasks will still run, but won't do anything. Note: This behavior differs from Rake, where re-opening a task definition extends the original declaration.

It is well worth looking at Lee Hambley's Railsless Deploys if you require all the magic of a standard deploy, but want to roll your own migration, database, restart or other code.

User Contributed Solutions

  • Submissions via github or the mailing list, we have some great resources for this section, we just need time to write them up!