Commit 1852c3ad

mo k <mo@mokhan.ca>
2011-07-05 04:03:30
add capfile targets to restart sphinx server.
1 parent 38af910
Changed files (2)
config/deploy.rb
@@ -27,7 +27,7 @@ ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "amazon-cakeside", "cakesid
 #
 namespace :deploy do
   task :start, :roles => :app do
-#    run "cd #{current_release} & rake thinking_sphinx:create RAILS_ENV=production & rake thinking_sphinx:start RAILS_ENV=production"
+    run "cd #{current_release} & rvm use 1.9.2 & rake thinking_sphinx:create RAILS_ENV=production & rake thinking_sphinx:start RAILS_ENV=production"
     run "touch #{current_release}/tmp/restart.txt"
   end
 
capfile
@@ -14,3 +14,21 @@ end
 task :show_free_space, :roles => :web do
   run "df -h /"
 end
+
+
+task :stop_sphinx , :roles => :app do
+  run "cd #{current_path} && rake thinking_sphinx:stop RAILS_ENV=production"
+end
+
+task :start_sphinx, :roles => :app do
+  run "cd #{current_path} && rake thinking_sphinx:configure RAILS_ENV=production && rake thinking_sphinx:start RAILS_ENV=production"
+end
+
+task :index_sphinx, :roles => :app do
+  run "cd #{current_path} && rvm use 1.9.2 && rake thinking_sphinx:index RAILS_ENV=production"
+end
+
+task :restart_sphinx, :roles => :app do
+  stop_sphinx
+  start_sphinx
+end