Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Add fast_remote_cache:prepare for priming the cached-copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Jun 11, 2008
1 parent 5df0fb4 commit 27838e4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/capistrano/recipes/deploy/strategy/fast_remote_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def setup!
upload(File.join(File.dirname(__FILE__), "utilities", "copy.rb"), File.join(bin_path, "copy.rb"))
end

def prepare!
update_repository_cache
end

private

def bin_path
Expand Down
16 changes: 15 additions & 1 deletion recipes/fast_remote_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@
if deploy_via == :fast_remote_cache
strategy.setup!
else
logger.warn "you're including the fast_remote_cache strategy, but not using it!"
logger.important "you're including the fast_remote_cache strategy, but not using it!"
end
end

desc <<-DESC
Updates the remote cache. This is handy for either priming a new box so
the cache is all set for the first deploy, or for preparing for a large
deploy by making sure the cache is updated before the deploy goes through.
Either way, this will happen automatically as part of a deploy; this task
is purely convenience for giving admins more control over the deployment.
DESC
task :prepare, :except => { :no_release => true } do
if deploy_via == :fast_remote_cache
strategy.prepare!
else
logger.important "#{current_task.fully_qualified_name} only works with the fast_remote_cache strategy"
end
end
end

after "deploy:setup", "fast_remote_cache:setup"

0 comments on commit 27838e4

Please sign in to comment.