Ah yes, thanks - that makes sense.
I did 2 other things in my env and have gotten it working after
following your example.
1. I hacked my own copy of "thinking-sphinx/lib/thinking_sphinx/deploy/
capistrano.rb" so that the stop task now looks like:
desc "Stop the Sphinx daemon"
task :stop do
begin
rake "thinking_sphinx:stop"
rescue RuntimeError
end
end
I did the above bc the thinking_sphinx:stop task throws an exception
if the process isnt already running. This would normally make rake
abort, which makes a first deployment fail. Also, I'm of the opinion
that if you want to stop sphinx and it's already stopped, its ok to
continue. If anyone has a better/cleaner solution, please share.
This does seem...slightly dirty to me.
2. In my deploy.rb, I put the following:
after 'deploy:setup', 'thinking_sphinx:shared_sphinx_folder'
after 'deploy:update', 'thinking_sphinx:rebuild'
Achieves the same thing your code does, but just means you chain a
method on a callback instead of overriding a method.
Thanks for your help!
On Jun 15, 4:42 pm, Wade Winningham <[email protected]> wrote:
> Check the comments. I have those commands commented out, but they are
> there. I just don't do them since my TS indexes aren't changing at
> all. I have Monit set up to keep searchd running so it keeps Sphinx
> running.
>
>
>
> On Mon, Jun 15, 2009 at 5:53 PM, kc<[email protected]> wrote:
>
> > Really? How do the thinking sphinx rake tasks get called? From what
> > I can tell, you only generate the shared directory on setup. But it
> > doesnt look like an index is ever generated (I would like to run index
> > on deployment since we're in a phase where we are often adjusting what
> > gets indexed) and I don't see a thinking_sphinx configure, stop, or
> > start. I ran a deployment with your code, and while the deployment
> > didn't error out, I also didn't end up with an instance of sphinx
> > running...
>
> > Am I missing part of your config?
>
> > Thanks!
>
> > On Jun 15, 3:22 pm, Wade Winningham <[email protected]> wrote:
> >> The following works for me.http://pastie.org/482368
>
> >> From my post on the topic
> >> athttp://www.updrift.com/article/thinkingsphinx-capistrano-tasks
>
> >> On Mon, Jun 15, 2009 at 4:33 PM, kc<[email protected]> wrote:
>
> >> > Hello,
>
> >> > Does anyone have detailed instructions for deploying thinking sphinx
> >> > with capistrano? Unfortunately I'm new to capistrano and am having a
> >> > little trouble finding clear documentation (pointers on this would be
> >> > appreciated as well).
>
> >> > Here's what I've tried so far:
>
> >> > In my Capfile:
> >> > require 'thinking_sphinx/deploy/capistrano'
>
> >> > In my deploy.rb:
> >> > namespace :deploy do
> >> > task :after_set_rails_env do
> >> > thinking_sphinx.stop
> >> > end
>
> >> > task :after_update do
> >> > # rebuilding the index is required if any changes were made to the
> >> > indexes
> >> > thinking_sphinx.index
> >> > thinking_sphinx.start
> >> > end
> >> > end
>
> >> > Also, following the example of Railscast #166 I put the following in
> >> > lib/thinking_sphinx.rake:
> >> > begin
> >> > require 'thinking_sphinx/tasks'
> >> > rescue LoadError
> >> > end
>
> >> > When I do a "cap integrated deploy" I get the following error:
> >> > * executing `integrated'
> >> > triggering start callbacks for `deploy'
> >> > * executing `multistage:ensure'
> >> > * executing `deploy'
> >> > * executing `deploy:update'
> >> > triggering before callbacks for `deploy:update'
> >> > * executing `deploy:set_rails_env'
> >> > * executing `deploy:after_set_rails_env'
> >> > * executing `thinking_sphinx:stop'
> >> > * executing `thinking_sphinx:configure'
> >> > * executing "cd /Library/Rails/blah/integrated/current && rake
> >> > thinking_sphinx:configure RAILS_ENV=production"
> >> > servers: ["localhost"]
> >> > Password:
> >> > [localhost] executing command
> >> > *** [err :: localhost] rake aborted!
> >> > *** [err :: localhost]
> >> > *** [err :: localhost] Don't know how to build task
> >> > 'thinking_sphinx:configure'
> >> > *** [err :: localhost]
> >> > *** [err :: localhost]
> >> > *** [err :: localhost] (See full trace by running task with --trace)
> >> > *** [err :: localhost]
> >> > ** [out :: localhost] (in /Library/Rails/blah/integrated/releases/
> >> > 20090613212247)
> >> > command finished
> >> > failed: "sh -c \"cd /Library/Rails/blah/integrated/current && rake
> >> > thinking_sphinx:configure RAILS_ENV=production\"" on localhost
>
> >> > Any help would be appreciated!
>
> >> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---