Sha256: e01d9724424ed4286e0f3c229e6c7e0a9f3e72e2691a94cc8f1698a2859b8322

Contents?: true

Size: 1.34 KB

Versions: 29

Compression:

Stored size: 1.34 KB

Contents

require 'thinking_sphinx/deploy/capistrano'

Capistrano::Configuration.instance(:must_exist).load do
  task :sphinx_stop, :roles => [:app] do
    # stop sphinx search daemon
    run "#{in_current} rake RAILS_ENV=production sphinx:stop"
  end

  task :sphinx_start, :roles => [:app] do
    # make sure sphinx can access the indexes
    sphinx_symlink_indexes
    # make sure a cron indexer is in place
    sphinx_setup_indexer
    # start search daemon
    run "#{in_current} rake RAILS_ENV=production sphinx:start"
  end

  task :sphinx_symlink_indexes, :roles => [:app] do
    run "test -e #{shared_path}/db || mkdir #{shared_path}/db"
    run "test -e #{shared_path}/db/sphinx || mkdir #{shared_path}/db/sphinx"
    run "ln -nfs #{shared_path}/db/sphinx #{current_path}/db/sphinx"
  end

  task :sphinx_setup, :roles => [:app] do
    # setup sphinx
    run "#{in_current} rake RAILS_ENV=production sphinx:setup"
  end

  task :sphinx_index, :roles => [:app] do
    # rebuild sphinx index now
    run "#{in_current} rake RAILS_ENV=production sphinx:index"
  end

  task :sphinx_setup_indexer, :roles => [:app] do
    # install cron job to rebuild indexes
    run "#{in_current} rake RAILS_ENV=production sphinx:setup_indexer"
  end

  # Hook start/stop methods into app start/stop/restart

  on_stop do
    sphinx_stop
  end

  on_start do
    sphinx_start
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
zena-1.2.8 bricks/sphinx/zena/deploy.rb
zena-1.2.7 bricks/sphinx/zena/deploy.rb
zena-1.2.6 bricks/sphinx/zena/deploy.rb
zena-1.2.5 bricks/sphinx/zena/deploy.rb
zena-1.2.4 bricks/sphinx/zena/deploy.rb
zena-1.2.3 bricks/sphinx/zena/deploy.rb
zena-1.2.2 bricks/sphinx/zena/deploy.rb
zena-1.2.1 bricks/sphinx/zena/deploy.rb
zena-1.2.0 bricks/sphinx/zena/deploy.rb
zena-1.1.3 bricks/sphinx/zena/deploy.rb
zena-1.1.2 bricks/sphinx/zena/deploy.rb
zena-1.1.1 bricks/sphinx/zena/deploy.rb
zena-1.1.0 bricks/sphinx/zena/deploy.rb
zena-1.0.0 bricks/sphinx/zena/deploy.rb
zena-1.0.0.rc3 bricks/sphinx/zena/deploy.rb
zena-1.0.0.rc2 bricks/sphinx/zena/deploy.rb
zena-1.0.0.rc1 bricks/sphinx/zena/deploy.rb
zena-0.16.9 bricks/sphinx/misc/deploy.rb
zena-1.0.0.beta3 bricks/sphinx/zena/deploy.rb
zena-0.16.8 bricks/sphinx/misc/deploy.rb