Created
September 2, 2012 11:04
-
-
Save NikoRoberts/3596906 to your computer and use it in GitHub Desktop.
deploy.rb - multi stage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rvm/capistrano' | |
require 'bundler/capistrano' | |
require 'capistrano/ext/multistage' | |
set :rvm_type, :user | |
default_run_options[:pty] = true # Must be set for the password prompt | |
set :stages, %w(staging production) | |
#set :default_stage, 'production' | |
set :application, 'helloworld' | |
# Capistrano assumes subversion, so if you use git, you need to specify it | |
set :scm, :git | |
# This makes capistrano keep a clone of the repo on the remote server so that it doesn't have to download an entire copy of the app w$ | |
set :deploy_via, :remote_cache | |
set :repository, "[email protected]:NikoRoberts/hellorackspace.git" | |
set :branch, 'master' | |
set :git_enable_submodules, true | |
set :use_sudo, false | |
# The default value is "--deployment --quiet", but if you don't | |
# commit your Gemfile.lock to the repo then you'll have problems | |
#set :bundle_flags, '--quiet' | |
# if you want to clean up old releases on each deploy uncomment this: | |
after "deploy:restart", "deploy:cleanup" | |
# This causes SSH connections to your git server to use the keys | |
# on your local machine instead of having to store them on the server | |
#ssh_options[:forward_agent] = true | |
namespace :deploy do | |
task :start do | |
# Do nothing | |
end | |
task :stop do | |
# Do nothing | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do | |
# touch the restart.txt file to cause Passenger to reload the application | |
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment