Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Robin Bowes authored November 03, 2010

Showing 1 changed file with 34 additions and 1 deletion. Show diff stats Hide diff stats

  1. 35  lib/railsless-deploy.rb
35  lib/railsless-deploy.rb
@@ -205,11 +205,44 @@ def try_runner(*args)
205 205
     task :update_code, :except => { :no_release => true } do
206 206
       logger.debug "Beginning railsless-deploy task - deploy:update_code"
207 207
       on_rollback { run "rm -rf #{release_path}; true" }
208  
-      strategy.deploy!
  208
+      transaction do
  209
+        update_cache
  210
+        compress_bundle
  211
+        upload_bundle
  212
+        decompress_bundle
  213
+      end
209 214
       finalize_update
210 215
     end
211 216
 
212 217
     desc <<-DESC
  218
+      [internal] Updates the local cached copy of the code
  219
+    DESC
  220
+    task :update_cache, :except => { :no_release => true } do
  221
+      strategy.update_cache!
  222
+    end
  223
+
  224
+    desc <<-DESC
  225
+      [internal] Creates a compressed bundle from the local code cache
  226
+    DESC
  227
+    task :compress_bundle, :except => { :no_release => true } do
  228
+      strategy.compress_bundle!
  229
+    end
  230
+
  231
+    desc <<-DESC
  232
+      [internal] Uploads the compressed bundle to the target node
  233
+    DESC
  234
+    task :upload_bundle, :except => { :no_release => true } do
  235
+      strategy.upload_bundle!
  236
+    end
  237
+
  238
+    desc <<-DESC
  239
+      [internal] Decompress the uploaded bundle on the target node
  240
+    DESC
  241
+    task :decompress_bundle, :except => { :no_release => true } do
  242
+      strategy.decompress_bundle!
  243
+    end
  244
+
  245
+    desc <<-DESC
213 246
       [internal] Touches up the released code. This is called by update_code \
214 247
       after the basic deploy finishes. It assumes a Rails project was deployed, \
215 248
       so if you are deploying something else, you may want to override this \

0 notes on commit 3cbb90f

Please sign in to comment.
Something went wrong with that request. Please try again.