Skip to content

Instantly share code, notes, and snippets.

@bjeanes
Created February 16, 2009 02:45
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 bjeanes/64967 to your computer and use it in GitHub Desktop.
Save bjeanes/64967 to your computer and use it in GitHub Desktop.
set :application, "TODO"
set :scm_username, "TODO"
set :user, application # assumes you create 1 user per app
set :domain, "#{application}.com" # this can be changed
set :use_sudo, false # everything is owned by user
role :app, domain # These options are fine for most cases
role :web, domain
role :db, domain, :primary => true
set :scm, :git # Git rocks.
set :repository, "git@github.com:#{scm_username}/#{application}.git" # GitHub makes Git rock even more
set :deploy_to, "/var/www/#{application}" # where the app is stored on the server (Apache default)
set :branch, "master" # branch of Git repository to use
set :deploy_via, :remote_cache # prevents fetching entire repository each time
set :git_enable_submodules, 1 # if you use git submodules, this will check them out for you
ssh_options[:forward_agent] = true # With this, you don't have to install a deploy key to access Git repository
namespace :deploy do
# Restarting a passenger instance is as easy as touching a file
desc "Restarting Passenger with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
# There is no starting/stopping with Passenger
# so this just stops mongrel from trying to do anything.
[:start, :stop].each do |t|
desc "#{t} task is a no-op with Passenger"
task t, :roles => :app do ; end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment