In my project, the /index directory, used by ferret, is not in the svn
repository, for obvious reasons.
Every time I deploy, /index is gone, and the first user to run a search
on the new deployment has a very… long… wait… ahead of them while
the app re-indexes every searchable object in the db.
Solutions?
migrate the index directory over from the previous deployment.
somehow, get ferret to reindex during deployment:
either by some magic method I don’t know about, calling
“/browse/all” on my app, or some such.
What I want to know is… How can I solve this problem with Capistrano.
(Surely it’s been dealt with dozens or hundreds of times before.)
In my project, the /index directory, used by ferret, is not in the svn
repository, for obvious reasons.
I have this very same setup.
Solutions?
migrate the index directory over from the previous deployment.
This is the cleanest solution IMHO. Your second approach isn’t
realistic when you’ll have millions of records to index! First, you
should create an ‘index’ directory in the shared path. Then, add this
to your deploy.rb:
namespace :deploy do
task :before_symlink do
run “ln -fs #{shared_path}/index #{release_path}/index”
end
end
(I know, this the old callbacks syntax with Cap 2, I was experencing
problems with the new syntax and haven’t retried since then. I’ll have
to.)