Sha256: c444e1226742e6bbb2c02be8645661bcb35e0801479bf97acc15474d3a0c981a

Contents?: true

Size: 1.96 KB

Versions: 1

Compression:

Stored size: 1.96 KB

Contents

Capistrano::Configuration.instance(:must_exist).load do

  namespace :sphinx do
    desc "After update_code you want to configure, then reindex"
    task :configure, :roles => [:app, :sphinx], :only => {:sphinx => true}, :except => {:no_release => true} do
      run "/engineyard/bin/searchd #{application} configure"
    end

    desc "After configure you want to reindex"
    task :reindex, :roles => [:app, :sphinx], :only => {:sphinx => true} do
      run "/engineyard/bin/searchd #{application} reindex"
    end
      
    desc "Start Sphinx Searchd"
    task :start, :roles => [:app, :sphinx], :only => {:sphinx => true} do
      sudo "/usr/bin/monit start all -g sphinx_#{application}"
    end
    desc "Stop Sphinx Searchd"
    task :stop, :roles => [:app, :sphinx], :only => {:sphinx => true} do
      sudo "/usr/bin/monit stop all -g sphinx_#{application}"
    end
    desc "Restart Sphinx Searchd"
    task :restart, :roles => [:app, :sphinx], :only => {:sphinx => true} do
      sudo "/usr/bin/monit restart all -g sphinx_#{application}"
    end        
    task :symlink, :roles => [:app, :sphinx], :only => {:sphinx => true}, :except => {:no_release => true} do
      run "if [ -d #{latest_release}/config/ultrasphinx ]; then mv #{latest_release}/config/ultrasphinx #{latest_release}/config/ultrasphinx.bak; fi"
      run "ln -nfs #{shared_path}/config/ultrasphinx #{latest_release}/config/ultrasphinx"
    end
    
  end
  
  namespace :thinking_sphinx do
    desc "Symlink the thinking sphinx config file and directory"
    task :symlink, :roles => [:app, :sphinx], :only => {:sphinx => true}, :except => {:no_release => true} do
      run "if [ -d #{latest_release}/config/thinkingsphinx ]; then mv #{latest_release}/config/thinkingsphinx #{latest_release}/config/thinkingsphinx.bak; fi"
      run "ln -nfs #{shared_path}/config/thinkingsphinx #{latest_release}/config/thinkingsphinx"
      run "ln -nfs #{shared_path}/config/sphinx.yml #{latest_release}/config/sphinx.yml"
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engineyard-eycap-0.3.8 lib/eycap/recipes/sphinx.rb