Skip to content

Commit

Permalink
Merge pull request #545 from iammichiel/master
Browse files Browse the repository at this point in the history
Rollback using the sudo context if available.
  • Loading branch information
willdurand committed Nov 19, 2014
2 parents 4d946f0 + d015f7c commit 4dd648d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/capifony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,21 @@ def prompt_with_default(var, default, &block)
run "#{try_sudo} mkdir -p #{dirs.join(' ')}"
run "#{try_sudo} chmod g+w #{dirs.join(' ')}" if fetch(:group_writable, true)
end

desc <<-DESC
Copies your project to the remote servers. This is the first stage \
of any deployment; moving your updated code and assets to the deployment \
servers. You will rarely call this task directly, however; instead, you \
should call the `deploy' task (to do a complete deploy) or the `update' \
task (if you want to perform the `restart' task separately).
You will need to make sure you set the :scm variable to the source \
control software you are using (it defaults to :subversion), and the \
:deploy_via variable to the strategy you want to use to deploy (it \
defaults to :checkout).
DESC
task :update_code, :except => { :no_release => true } do
on_rollback { run "#{try_sudo} rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end
end

0 comments on commit 4dd648d

Please sign in to comment.