Created
November 18, 2009 14:04
-
-
Save UserAd/237870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :sphinx do | |
desc 'make symlinks' | |
task :symlink do | |
run <<-CMD | |
if [ ! -d #{shared_path}/sphinx ]; then mkdir -p #{shared_path}/sphinx; fi; | |
rm -fr #{release_path}/db/sphinx && | |
ln -nfs #{shared_path}/sphinx #{release_path}/db/sphinx | |
CMD | |
end | |
desc 'update config file' | |
task :conf, :roles => :app do | |
run "cd #{current_path} && rake ts:conf RAILS_ENV=production" | |
end | |
desc 'Stop the sphinx server' | |
task :stop , :roles => :app do | |
conf | |
run "cd #{current_path} && rake thinking_sphinx:stop RAILS_ENV=production" | |
end | |
desc 'Start the sphinx server' | |
task :start, :roles => :app do | |
run "cd #{current_path} && rake thinking_sphinx:configure RAILS_ENV=production && rake thinking_sphinx:start RAILS_ENV=production" | |
end | |
desc 'Restart the sphinx server' | |
task :restart, :roles => :app do | |
stop | |
start | |
end | |
desc 'Rebuild search index' | |
task :rebuild do | |
run "cd #{current_path} && rake thinking_sphinx:rebuild RAILS_ENV=production" | |
end | |
end | |
after 'deploy:symlink', 'sphinx:symlink' | |
after 'deploy:restart', 'sphinx:restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment