Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add additional tasks to call various parts of the deploy strategy ind…

…ividually to permit callbacks to hook into each stage. Requires changes to capistrano deploy.rb
  • Loading branch information...
commit 3cbb90f97e81e7a61872c03fc9571fab47fcc4d3 1 parent 52fff22
@robinbowes authored
Showing with 34 additions and 1 deletion.
  1. +34 −1 lib/railsless-deploy.rb
View
35 lib/railsless-deploy.rb
@@ -205,11 +205,44 @@ def try_runner(*args)
task :update_code, :except => { :no_release => true } do
logger.debug "Beginning railsless-deploy task - deploy:update_code"
on_rollback { run "rm -rf #{release_path}; true" }
- strategy.deploy!
+ transaction do
+ update_cache
+ compress_bundle
+ upload_bundle
+ decompress_bundle
+ end
finalize_update
end
desc <<-DESC
+ [internal] Updates the local cached copy of the code
+ DESC
+ task :update_cache, :except => { :no_release => true } do
+ strategy.update_cache!
+ end
+
+ desc <<-DESC
+ [internal] Creates a compressed bundle from the local code cache
+ DESC
+ task :compress_bundle, :except => { :no_release => true } do
+ strategy.compress_bundle!
+ end
+
+ desc <<-DESC
+ [internal] Uploads the compressed bundle to the target node
+ DESC
+ task :upload_bundle, :except => { :no_release => true } do
+ strategy.upload_bundle!
+ end
+
+ desc <<-DESC
+ [internal] Decompress the uploaded bundle on the target node
+ DESC
+ task :decompress_bundle, :except => { :no_release => true } do
+ strategy.decompress_bundle!
+ end
+
+ desc <<-DESC
[internal] Touches up the released code. This is called by update_code \
after the basic deploy finishes. It assumes a Rails project was deployed, \
so if you are deploying something else, you may want to override this \
Please sign in to comment.
Something went wrong with that request. Please try again.