Capistrano::Configuration.instance.load do ###################### ## Multistage setup ## ###################### set(:stages, %w[alpha beta staging production]) # branches that must ask for a commit, and have that commit in their history set(:branch_stages, %w[staging production]) # stages that will reset the database to a reference database before running # migrations set(:reference_db_stages, %w[alpha beta staging]) desc "This task is just for testing loading of the recipes and multistage requirements in an app" task :testing do puts "You are testing task loading for #{stage}. #{stage_loaded}" end #################### # General Settings # #################### set(:use_sudo, false) set(:deploy_via, :remote_cache) set(:ssh_options, {:forward_agent => true}) set(:scm, :git) set(:copy_exclude, %w[.git]) set(:repository) { "git@github.com:projectdx/#{application}.git" } set(:user) { application } set(:deploy_to) { "/var/www/#{application}" } set(:db_username) { application } set(:db_server, 'db1.renewfund.com') set(:db_password) { abort "You must set the database password for this application with `set :db_password, 'foo'." } set(:db_port, '5433') set(:db_name) { application } set(:rails_env) { stage } ############# # Callbacks # ############# before 'deploy:update', 'deploy:get_revision' after 'deploy:update_code', 'deploy:migrate' before 'deploy:migrate', 'deploy:db:create' after 'deploy:migrate', 'deploy:db:seed' before 'deploy:db:create', 'deploy:db:copy_database_yml' ############################ # Additional Files to Load # ############################ # # Be aware that #load in this context is not at all the same as Kernel#load. # Thanks, Capistrano! # load_paths << File.expand_path(File.join(File.dirname(__FILE__), 'capistrano')) require 'bundler/capistrano' require 'capistrano/ext/multistage' load 'passenger' load 'database_configuration' load 'git_revision' load 'deploy/assets' load 'maintenance' end