set :application, '<%=@app_name%>' set :keep_releases, 5 set :rails_env, 'stage' set :scm, 'git' set :repository, 'git@git.rarolabs.com.br:rarolabs/<%=@app_name%>.git' set :branch, 'master' set :deploy_via, :remote_cache default_run_options[:pty] = true ssh_options[:forward_agent] = true set :user, 'raro' set :port, 22 set :use_sudo, false set(:unicorn_env) { rails_env } load 'deploy/assets' server '<%=@app_ip%>', :web, :app, :db, :primary => true set :deploy_to, "/app/<%=@app_name%>/" # runs bundle install on remote server require "bundler/capistrano" # if you want to clean up old releases on each deploy uncomment this: after "deploy:restart", "deploy:cleanup" before 'deploy:setup', 'rvm:install_rvm' after 'deploy:restart', 'unicorn:restart' before "deploy:assets:precompile", "deploy:migrate" before 'deploy:finalize_update', 'deploy:assets:symlink' after 'deploy:update_code', 'deploy:assets:precompile' after :deploy, 'deploy:restart' namespace :deploy do task :restart, :roles => :app, :except => { :no_release => true } do run "cd #{current_path} && touch tmp/restart.txt" end end