Skip to content

Instantly share code, notes, and snippets.

@xdite
Created August 13, 2010 04:29
Show Gist options
  • Save xdite/522282 to your computer and use it in GitHub Desktop.
Save xdite/522282 to your computer and use it in GitHub Desktop.
set :application, "test-project"
set :repository, "git://github.com/xdite/test-project.git"
set :branch, "master"
set :deploy_to, "/home/apps/test-project"
set :user, "apps"
#set :port, "1234"
set :use_sudo, false
set :scm, "git"
set :deploy_via, :remote_cache
set :rake, "/opt/ruby-enterprise/bin/rake"
role :app, "1.2.3.4"
role :web, "1.2.3.4"
role :db, "1.2.3.4", :primary => true
namespace :deploy do
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
end
namespace :my_tasks do
desc "Create database.yml and asset packages for staging"
task :symlink, :roles => [:app] do
symlink_hash = {
"#{shared_path}/config/database.yml" => "#{release_path}/config/database.yml",
"#{shared_path}/system" => "#{release_path}/public/system"
}
symlink_hash.each do |source, target|
run "ln -sf #{source} #{target}"
end
end
end
after "deploy:update_code", "my_tasks:symlink"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment