Created
June 8, 2009 15:39
-
-
Save adambyrtek/125883 to your computer and use it in GitHub Desktop.
Capistrano recipe to deploy a simple Rails app with frozen gems from a given repository tag
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
set :application, "foobar" | |
set :deploy_to, "/home/deployer/foobar" | |
set :user, "deployer" | |
set :use_sudo, false | |
set :deploy_via, :export | |
set :repository do | |
fail "Provide TAG environment variable to select tag to deploy from." if ENV['TAG'].nil? | |
"https://svn.example.com/#{application}/tags/" + ENV['TAG'] | |
end | |
server "app.example.com", :app, :web, :db, :primary => true | |
namespace :deploy do | |
task :default, :roles => :app do | |
# Always deploy with migrations by default | |
migrations | |
end | |
task :after_update_code, :roles => :app do | |
# Copy configuration | |
run "ln -s #{shared_path}/config/database.yml #{release_path}/config/database.yml" | |
# Build native gems | |
run "cd #{release_path} && rake gems:build" | |
end | |
task :restart, :roles => :app do | |
# Passenger restart | |
run "touch #{current_path}/tmp/restart.txt" | |
end | |
task :start, :roles => :app do | |
restart | |
end | |
task :stop, :roles => :app do | |
# Nothing to do for Passenger | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment