Skip to content

Instantly share code, notes, and snippets.

@joesavak

joesavak/deploy.rb

Created Jun 21, 2011
Embed
What would you like to do?
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
You can’t perform that action at this time.