Browse files

Make cache group-writable before deploy.

  • Loading branch information...
1 parent af7214c commit e08b9f041c0a70145d3074957f970378fabd4d40 @jamis jamis committed Jun 5, 2008
Showing with 13 additions and 2 deletions.
  1. +13 −2 recipes/fast_remote_cache.rb
View
15 recipes/fast_remote_cache.rb
@@ -8,14 +8,25 @@
a new machine. It is also necessary to invoke when you are switching to the
fast_remote_cache strategy for the first time.
DESC
- task :setup do
+ task :setup, :except => { :no_release => true } do
if deploy_via == :fast_remote_cache
strategy.setup!
else
logger.warn "you're including the fast_remote_cache strategy, but not using it!"
end
end
+ desc <<-DESC
+ Make sure the cached-copy is group writable. This ensures that when used
+ in a team environment, multiple individuals may deploy using this
+ strategy.
+ DESC
+ task :make_cache_writable, :except => { :no_release => true } do
+ cache = File.join(shared_path, fetch(:repository_cache, "cached-copy"))
+ sudo "chmod -R g+w #{cache}; true"
+ end
+
end
-after "deploy:setup", "fast_remote_cache:setup"
+after "deploy:setup", "fast_remote_cache:setup"
+before "deploy:update_code", "fast_remote_cache:make_cache_writable"

0 comments on commit e08b9f0

Please sign in to comment.