Skip to content

Instantly share code, notes, and snippets.

@fabriziomachado
Created August 10, 2011 23:09
Show Gist options
  • Save fabriziomachado/1138532 to your computer and use it in GitHub Desktop.
Save fabriziomachado/1138532 to your computer and use it in GitHub Desktop.
Arquivo de configuração do capistrano
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, '1.9.2@rails3' # Or whatever env you want it to run in.
set :rvm_type, :user
# bundler bootstrap
require 'bundler/capistrano'
#ssh_options[:auth_methods] = %w(password keyboard-interactive)
#default_run_options[:pty] = true
#default_run_options[:shell] = false
# main details
set :application, "app.demo.org"
role :web, "app.demo.org"
role :app, "app.demo.org"
role :db, "app.demo.org", :primary => true
# server details
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :deploy_to, "/var/www/app.demo.org"
set :deploy_via, :remote_cache
set :user, "deployer"
set :use_sudo, false
# repo details
set :scm, :git
set :scm_username, "fabrizio"
set :repository, "git@pavilion:app.demo"
set :branch, "master"
set :git_enable_submodules, 1
# tasks
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_path}/tmp/restart.txt"
end
task :stop, :roles => :app do
# Do nothing.
end
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{current_path}/tmp/restart.txt"
end
desc "Symlink shared resources on each release - not used"
task :symlink_shared, :roles => :app do
#run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
end
after 'deploy:update_code', 'deploy:symlink_shared'
#after "bundle:install", "deploy:migrate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment