Created
October 10, 2012 20:17
-
-
Save josemarluedke/3868139 to your computer and use it in GitHub Desktop.
Capistrano configurations for Rails Application
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
load 'deploy' | |
load 'deploy/assets' # Assets pipeline for Rails application | |
load 'config/deploy' |
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" | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true # Allows deploy use my ssh keys | |
# Application | |
set :application, "events4me" # Application name | |
# The addresses of servers involved in the deployment | |
role :web, "linode.josemarluedke.com" | |
role :app, "linode.josemarluedke.com" | |
role :db, "linode.josemarluedke.com", :primary => true | |
# Repository informations | |
set :scm, :git | |
set :repository, "[email protected]:josemarluedke/events4me.git" | |
set :branch, 'master' | |
set :user, "deploy" # The deploy user | |
set :deploy_to, "/home/deploy/www/#{application}" # Makes deploy in this path | |
# Makes deploy be faster using a repository cache (in server) | |
set :deploy_via, :remote_cache | |
# For safety. Is not need to use sudo because :deploy_to can be written by :user | |
set :use_sudo, false | |
# Other options | |
set :git_enable_submodules, 1 | |
set :scm_verbose, true | |
# if you're still using the script/reaper helper you will need | |
# these http://github.com/rails/irs_process_scripts | |
# If you are using Passenger mod_rails uncomment this: | |
namespace :deploy do | |
task :start do ; end | |
task :stop do ; end | |
# Restart the application | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
run "touch #{File.join(current_path,'tmp','restart.txt')}" | |
end | |
# Copy the /home/deploy/database.yml to application path | |
task :db_config, :roles => :app, :except => { :no_release => true } do | |
run "cp -f ~/database.yml #{release_path}/config/database.yml" | |
end | |
end | |
after "deploy:finalize_update", "deploy:db_config" | |
after "deploy", "deploy:migrate" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment