Installation & Deployment Guide: Deploying with Capistrano

Capistrano is the recommended tool for deploying Wheelhouse to your own dedicated server or VPS.

This page is not intended to be a full guide for using Capistrano (for that see the Capistrano Wiki) but should assist you in using Capistrano to deploy Wheelhouse CMS.

Setting up Capistrano

1. Add Capistrano to your project:

$ cd MyProject
$ capify .

2. Customize your config/deploy.rb file and add:

require 'bundler/capistrano'
require 'wheelhouse/capistrano'

This ensures that the following happens on deploy:

  1. bundle install is run
  2. Theme and application assets are compiled
  3. Shared media and asset symlinks are created

3. Depending on your deployment platform, you may need to install a JavaScript runtime environment in order to compile assets. The recommended runtime is therubyracer, which can be added to the assets group in your Gemfile as follows:

group :assets do
gem 'therubyracer'

Deployment Recipe (config/deploy.rb)

The following recipe provides a starting point for your config/deploy.rb configuration.

require 'bundler/capistrano'
require 'wheelhouse/capistrano'

# If you are using RVM on the deployment target, install the
# rvm-capistrano gem and uncomment the following lines:
# require 'rvm/capistrano'
# set :rvm_type, :system set :application, "*DOMAIN*" set :domain, "*DOMAIN*" set :deploy_to, "/var/www/#{application}" set :scm, "git" set :repository, "*GIT REPOSITORY LOCATION*" set :git_enable_submodules, 1 set :deploy_via, :remote_cache set :use_sudo, false ssh_options[:forward_agent] = true role :app, domain role :web, domain role :db, domain, :primary => true namespace :deploy do task :start, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end task :stop, :roles => :app do # Do nothing. end desc "Restart Application" task :restart, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end end

Additional Capistrano Resources