Skip to content

Instantly share code, notes, and snippets.

@everm1nd
Created August 8, 2012 15:43
Show Gist options
  • Save everm1nd/3296079 to your computer and use it in GitHub Desktop.
Save everm1nd/3296079 to your computer and use it in GitHub Desktop.
Capistrano: Solr
task :before_update_code do
#stop solr:
run "cd #{current_path} && rake sunspot:solr:stop RAILS_ENV=#{rails_env}"
end
after "deploy:update_crontab", "deploy:solr:symlink"
namespace :solr do
desc <<-DESC
Symlink in-progress deployment to a shared Solr index.
DESC
task :symlink, :except => { :no_release => true } do
run "ln -nfs #{shared_path}/solr #{current_path}/solr"
run "ls -al #{current_path}/solr/pids/"
run "cd #{current_path} && rake sunspot:solr:start RAILS_ENV=#{rails_env}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment