On Fri, Oct 24, 2008 at 4:24 PM, theduz <[EMAIL PROTECTED]> wrote:

> What is the correct way to extend remote_cache.rb?  Should I change it
> in place? copy it to remote_cache_rsync.rb in the same folder and hack
> it?  Put it somewhere in my project?  If so, where?


As for "put it somewhere in your project", that's entirely up to you. I'd
suggest plugin-izing it -- the default Capfile will load
vendor/plugins/*/recipies. Here's what I did:

in vendor/plugins/my_strategy/recipes/whatever.rb:
$:.unshift File.join(File.dirname(__FILE__), 'lib')

Then, in
vendor/plugins/my_strategy/recipes/lib/capistrano/recipes/deploy/strategy/my_strategy.rb,
you'd add a new strategy, inheriting from
Capistrano::Deploy::Strategy::RemoteCache, and overriding what you need.

I overrode update_repository to do an 'svn switch' instead (since we tag
every release in SVN), and overrode copy_repository_cache to do an rsync
(explicitly excluting dot-svn folders) instead of 'svn export', as the
latter didn't handle externals properly at the time. It ends up using
exactly the one cached-copy, no subsequent 'cp' needed.

In order to do that properly, I also ripped open SCM::Subversion and added a
'switch' method.

If there's a recommended way of doing this, that probably isn't it, but it's
a start.


...also: What are you doing that takes up 1 gig? Are you sure all of that
actually belongs in the repository?

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to