Skip to content

Instantly share code, notes, and snippets.

@joesavak
Created June 21, 2011 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesavak/1038415 to your computer and use it in GitHub Desktop.
Save joesavak/1038415 to your computer and use it in GitHub Desktop.
sunspot bounce in deploy.rb
set somevars, "foobar"
namespace :deploy do
task :default do
update
someother_task
reindex_solr
end
task :reindex_solr do
rails_env = fetch(:rails_env, "test")
begin
run "cd #{current_path}; #{rake} RAILS_ENV=#{rails_env} sunspot:solr:stop"
rescue Exception => e
puts e.message
puts "!!!!!!!!!!!!!!! Solr does not appear to be up running"
end
run "cd #{current_path}; #{rake} RAILS_ENV=#{rails_env} sunspot:solr:start"
run "cd #{current_path}; #{rake} RAILS_ENV=#{rails_env} sunspot:reindex"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment