Created
January 27, 2012 22:14
-
-
Save jcode/1691214 to your computer and use it in GitHub Desktop.
Capistrano
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, "myapp" | |
set :deploy_via, :remote_cache | |
set :deploy_to, "/var/rails/#{application}" | |
set :keep_releases, 2 | |
set :branch, "master" | |
set :use_sudo, false | |
role :app, "mydomain.com" | |
role :db, "mydomain.com", :primary => true | |
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
ssh_options[:forward_agent] = true # Use the developer keys for the deployment | |
set :repository, "[email protected]:myaccount/myrepo.git" | |
set :scm, "git" | |
set :user, "root" | |
namespace :deploy do | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
run("cd #{release_path}; bundle install") | |
run "cd #{release_path}; RAILS_ENV=production rake assets:precompile" | |
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment