Skip to content

Instantly share code, notes, and snippets.

@ilstar
Created July 9, 2012 10:09
Show Gist options
  • Save ilstar/3075564 to your computer and use it in GitHub Desktop.
Save ilstar/3075564 to your computer and use it in GitHub Desktop.
Capistrano example
$:.unshift(File.expand_path("./lib", ENV['rvm_path']))
require 'rvm/capistrano'
require 'bundler/capistrano'
require "whenever/capistrano"
set :rvm_ruby_string, '1.9.3'
set :rvm_type, :user
set :whenever_command, "bundle exec whenever"
set :domain, "your.domain"
set :application, "your_app"
set :deploy_to, "/path/to/#{application}"
set :deploy_via, :remote_cache
set :user, "username"
set :use_sudo, false
set :scm, :git
set :repository, "[email protected]:example.git"
set :branch, 'master'
set :git_shallow_clone, 1
# you can use below if you only have one server.
# server domain, :app, :web, :db, :primary => true
role :web, domain
role :app, domain
role :db, domain, :primary => true
# if you want to clean up old releases on each deploy uncomment this:
# after "deploy:restart", "deploy:cleanup"
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
namespace :deploy do
task :start do
run "thin -C config/thin.yml start"
end
task :stop do
run "thin -C config/thin.yml stop"
end
task :restart do
run "thin -C config/thin.yml restart"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment