Skip to content

Instantly share code, notes, and snippets.

@excid3
Created June 18, 2012 19:02
Show Gist options
  • Select an option

  • Save excid3/2950079 to your computer and use it in GitHub Desktop.

Select an option

Save excid3/2950079 to your computer and use it in GitHub Desktop.
Capistrano setup
#$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'bundler/capistrano'
set :stages, %w(production staging)
set :keep_releases, 3
set :default_stage, "staging"
require 'capistrano/ext/multistage'
set :whenever_command, "bundle exec whenever"
set :whenever_environment, defer { stage }
set :whenever_identifier, defer { "#{application}_#{stage}" }
require "whenever/capistrano"
set :application, "tourly"
set :scm, :git
set :repository, "git@github.com:excid3/tourly.git"
set :deploy_via, :remote_cache
set :deploy_env, 'production'
# User local keys, not server keys
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :default_environment, { 'PATH' => '/usr/local/rvm/gems/ruby-1.9.3-p125/bin:/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p125/bin:/usr/local/rvm/bin:$PATH' }
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
desc "Symlink shared configs and folders on each release."
task :symlink_shared do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
after 'deploy:finalize_update', 'deploy:symlink_shared'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment