Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'vendor/plugins/thinking-sphinx/recipes/thinking_sphinx'

# ...

namespace :deploy do

  task :rebuild_index, :roles => :app do
    thinking_sphinx.stop # turn off TS using the old production.sphinx.conf
    update
    thinking_sphinx.index
    thinking_sphinx.start
    restart
  end

end

task :symlink_sphinx_indexes, :roles => [:app] do
  run "ln -nfs #{shared_path}/db/sphinx #{current_path}/db/sphinx"
end

# this is where i load my production configuration files
task :update_config, :roles => [:app], :except => { :no_release => true } do
  # ...
  thinking_sphinx.configure
end  

before 'deploy:finalize_update', :symlink_sphinx_indexes
before 'deploy:finalize_update', :update_config