Skip to content

Instantly share code, notes, and snippets.

@miaout17
Created October 18, 2010 17:44
Show Gist options
  • Save miaout17/632653 to your computer and use it in GitHub Desktop.
Save miaout17/632653 to your computer and use it in GitHub Desktop.
My Capistrano Deploy.rb
set :application, "abc"
set :repository, "git://github.com/gaagaaga/abcde.git"
set :scm, :git
set :user, 'deploy'
set :use_sudo, false
set :deploy_to, "/home/deploy/rapp/abc"
set :deploy_via, :remote_cache
role :web, "aaaa.bbb.com" # Your HTTP server, Apache/etc
role :app, "aaaa.bbb.com" # This may be the same as your `Web` server
role :db, "aaaa.bbb.com", :primary => true # This is where Rails migrations will run
after "deploy", "my_tasks:post_deploy"
default_environment["PATH"] = "/opt/ruby/bin:/usr/bin:/bin:/usr/sbin:/sbin"
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
namespace :my_tasks do
task :post_deploy do
run "ln -sf #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -sf #{shared_path}/public/photo_store #{release_path}/public/photo_store"
# run "ln -sf #{shared_path}/vendor/gems #{release_path}/vendor/gems"
run "cd #{deploy_to}/current && bundle install vendor/gems"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment