Skip to content

Instantly share code, notes, and snippets.

@HarryGuerrilla
Created July 11, 2009 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarryGuerrilla/145348 to your computer and use it in GitHub Desktop.
Save HarryGuerrilla/145348 to your computer and use it in GitHub Desktop.
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
set :repository, 'git://github.com/username/git-repo.git' # change this to the git repository
set :scm, :git
set :deploy_via, :copy
set :git_shallow_clone, 1
set :user, 'username' # change this to dreamhost username
set :application, 'dreamhost.com' # change this to foldername of rails app
set :deploy_to, "/home/#{user}/#{application}"
set :use_sudo, false
set :domain, "#{user}@#{application}"
role :app, domain
role :web, domain
role :db, domain, :primary => true
before 'deploy:update_code', 'deploy:web:disable'
after 'deploy:update_code', 'deploy:upload_config_files'
after 'deploy:restart', 'deploy:cleanup'
after 'deploy:restart', 'deploy:web:enable'
namespace :deploy do
task :restart, :roles => :app do
run "touch #{current_path}/tmp/restart.txt"
end
task :upload_config_files do
put(File.read('config/database.yml'), "#{release_path}/config/database.yml", :mode => 0444)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment