Created
November 7, 2012 16:00
-
-
Save tinti/4032444 to your computer and use it in GitHub Desktop.
Rails 3.2.0 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
#require "bundler/capistrano" | |
require "rvm/capistrano" | |
# General | |
set :application, "test_capistrano" | |
set :domain, "test_capistrano.mxt.com.br" | |
set :user, "mxt" | |
set :runner, "mxt" | |
set :use_sudo, false | |
set :deploy_to, "/home/mxt/rails/#{application}" | |
set :repository_cache, "#{application}_cache" | |
set :environment, "production" | |
set :rvm_type, :user | |
#set :rvm_bin_path, "/home/mxt/.rvm/bin" | |
# Roles | |
role :web, "test_capistrano.mxt.com.br" | |
role :app, "test_capistrano.mxt.com.br" | |
role :db, "test_capistrano.mxt.com.br", :primary => true | |
# GIT | |
set :repository, "[email protected]:/home/mxt/git/test_capistrano.git" | |
set :branch, "master" | |
set :keep_releases, 5 | |
set :deploy_via, :remote_cache | |
set :scm, :git | |
set :scm_username, "git" | |
set :scm_passphrase, Capistrano::CLI.password_prompt("Type your ssh passphrase for user #{scm_username}: ") | |
# SSH | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true | |
ssh_options[:paranoid] = true # comment out if it gives you trouble. newest net/ssh needs this set. | |
######## Callbacks - No More Config ######## | |
after 'deploy:symlink', 'deploy:cleanup' # makes sure there's only 3 deployments, deletes the extras | |
# Custom Tasks | |
namespace :deploy do | |
task(:start) {} | |
task(:stop) {} | |
desc "Restart Application" | |
task :restart, :roles => :web, :except => { :no_release => true } do | |
run "touch #{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