So here is my minimal version of deploying a simple web site with Capistrano (basically Pat's code with Apache related stuff removed and a micro task that removes the Capfile and config/ directories from the release):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modifications from standard capistrano deploy as taken from: | |
# http://devthatweb.com/view/deploy-any-project-using-capistrano-2 | |
set :application, "name removed" | |
set :repository, "url to trunk of repo" | |
# If you aren't deploying to /u/apps/#{application} on the target | |
# servers (which is the default), you can specify the actual location | |
# via the :deploy_to variable: | |
set :deploy_to, "/var/www/#{application}" | |
# If you aren't using Subversion to manage your source code, specify | |
# your SCM below: | |
# set :scm, :subversion | |
set :domain, 'our domain removed' | |
role :app, domain | |
role :web, domain | |
role :db, domain, :primary => true | |
namespace :deploy do | |
task :setup, :except => { :no_release => true } do | |
dirs = [deploy_to, releases_path, shared_path] | |
dirs += %w(system).map { |d| File.join(shared_path, d) } | |
run "umask 02 && mkdir -p #{dirs.join(' ')}" | |
end | |
# Also overwritten to remove Rails-specific code. | |
task :finalize_update, :except => { :no_release => true } do | |
run "chmod -R g+w #{release_path}" if fetch(:group_writable, true) | |
end | |
task :migrate do | |
end | |
task :migrations do | |
end | |
task :cold do | |
end | |
task :start do | |
end | |
task :stop do | |
end | |
task :restart do | |
end | |
end | |
desc "remove the Capfile and config" | |
task :after_update_code do | |
run "rm #{release_path}/Capfile" | |
run "rm -rf #{release_path}/config" | |
end |