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:
http://peepcode.com/products/capistrano-concepts
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)
end
task :restart, :roles => :app do
# Do nothing
end
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"
end
desc "Post-deploy cleanup"
task :after_default, :roles => :app do
# Keep last 5 releases
cleanup
end
end