Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Deploy Mint with Capistrano

I keep a copy of Mint in a private Subversion repository and deploy it to my site with Capistrano, a Ruby-based deployment tool.

Here’s a skeleton of the Capfile that I use (requires Capistrano version 2). It assumes that you have a copy of your production db.php config file at Capistrano’s shared/config/db.php.

For more details, see the Capistrano site or my hour-long, $9 screencast on the topic:


require 'capistrano/version'
load 'deploy' if respond_to?(:namespace) # cap2 differentiator

set :application, "mint.mysite.com"
set :repository,  "http://my_svn_server.com/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
# set :scm, :subversion

# Target directory for the application on the web and app servers.
set :deploy_to, "/full_path/to/top/directory/of/site/#{application}"
set :deploy_via, :remote_cache

# Login user for ssh.
set :user, "my_ssh_user"

# You shouldn't need to edit anything below here unless you are doing
# special customization.

role :app, application
role :web, application
role :db,  application, :primary => true

namespace :deploy do

  desc "Overridden since PHP doesn't have some of the Rails directories"
  task :finalize_update, :except => { :no_release => true } do
    # Make directories writeable by the deployment user's group
    run "chmod -R g+w #{release_path}" if fetch(:group_writable, true)

  task :restart, :roles => :app do
    # Do nothing

  desc "Copy db files"
  task :after_update_code, :roles => :app do
    run "cp #{shared_path}/config/db.php #{release_path}/public/mint/config/db.php"

  desc "Post-deploy cleanup"
  task :after_default, :roles => :app do
    # Keep last 5 releases


This seems excellent, though I foolishly omitted PHP when I installed my Rails stack. I’m not sure what kind of tomfoolery I’d have to go through in order to do it this late in the game.

By the way, I think Peepcode has taught me more about Ruby on Rails than almost anything else, save for the Agile Web Development with RoR book. Keep up the good work!

I decided to tough it up and figure it out. I also created a Capistrano 2 recipe to automate Mint deployment. You can read more about it here:


It’s rough around the edges, but it’s been working for me. If any of you take a look have any thoughts, leave a comment. Thanks.

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue