Created
May 19, 2012 05:45
-
-
Save bazzel/2729441 to your computer and use it in GitHub Desktop.
Capistrano's deploy.rb with RVM multi user install
This file contains hidden or 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
# RVM bootstrap | |
set :rvm_ruby_string, '1.9.2-p320@[appname]' | |
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
# When using whenever gem: | |
# set :whenever_command, "bundle exec whenever" | |
# require 'whenever/capistrano' | |
set :rvm_type, :system | |
# bundler bootstrap | |
require 'bundler/capistrano' | |
# main details | |
set :application, "[appname]" | |
role :web, "[domain]" | |
role :app, "[domain]" | |
role :db, "[domain]", :primary => true | |
# server details | |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true | |
set :deploy_to, "/var/www/[appname]" | |
set :deploy_via, :remote_cache | |
set :user, "passenger" | |
set :use_sudo, false | |
# repo details | |
set :scm, :git | |
set :scm_username, "passenger" | |
set :repository, "[email protected]:[github_account]/[appname].git" | |
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' | |
load 'deploy/assets' |
This file contains hidden or 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
gem 'capistrano' | |
gem 'rvm-capistrano' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment