Afternoon,
I've spent some time this morning getting my head around how the
thinking sphinx capistrano tasks work. My understanding is that the
default tasks (as described on the deployment page[1]) will execute
the thinking sphinx tasks in /<app>/current. As these tasks happen
before and after deploy:update_code they will execute in the currently
deployed version of the app, i.e. *not* the version that's in the
process of becoming the deployed version (because the current symlink
doesn't get changed until the end of the deployment task). The result
is that, after a successful deploy, the current version of the app
doesn't have a sphinx config file (e.g. config/sphinx.staging.conf) or
a symlink to the indexes (db/sphinx/).
Although I find this confusing, I don't think it becomes a problem
until you come to rebuild the indexes (again, as documented on the
deployment page[1]). The suggested command to rebuild the indexes is
"cd /path/to/app/current && /usr/local/bin/rake
thinking_sphinx:rebuild". Running that command results in an error
because it tries to read the config file from the current directory
and that doesn't exist.
The approach I'm favouring at the moment is to change the thinking
sphinx tasks to run after 'deploy:restart' so that sphinx is
configured and started from the actually deployed version of the app.
Does that sound sensible?
Cheers, Chris
[1]
http://freelancing-god.github.com/ts/en/deployment.html