Created
September 30, 2011 21:16
-
-
Save mhayes/1254996 to your computer and use it in GitHub Desktop.
Capistrano for Rails 3.1
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
require 'capistrano/ext/multistage' | |
require "bundler/capistrano" | |
#use local key for authentication | |
ssh_options[:forward_agent] = true | |
default_run_options[:pty] = true | |
set :application, 'awesome' | |
set :repository, "[email protected]:zurb/awesome.git" | |
set :deploy_via, :remote_cache | |
set :scm, "git" | |
set :use_sudo, false | |
set :user, application | |
set :branch, 'master' | |
after "deploy:update_code", "db:symlink" | |
# if you're symlinking production database.yml do this | |
before "deploy:assets:precompile", "db:symlink" | |
namespace :db do | |
desc "Make symlink for database yaml" | |
task :symlink do | |
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" | |
end | |
end | |
namespace :deploy do | |
desc "Restart Application" | |
task :restart, :roles => :app do | |
run "touch #{current_path}/tmp/restart.txt" | |
end | |
end |
before "deploy:assets:precompile", "db:symlink"
Thank You!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pay attention to:
before "deploy:assets:precompile", "db:symlink"
Otherwise some capistrano deployments may fail.