Sha256: 04829d2cbc25e94d34f388666fa5ef32f4eaecaa4bed5186be993cfcaa11b632

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

namespace :sunspot do
  desc 'setup solr data dir'
  task :setup_solr_data_dir do
    on roles :app do
      within shared_path do
        execute :mkdir, "-p #{shared_path}/solr"
      end
    end
  end

  desc 'link to solr shared dirs'
  task :link_to_solr_shared_dirs do
    on roles :app do
      within shared_path do
        execute :rm, "-rf #{release_path}/solr/solr"
        execute :ln, "-s #{shared_path}/solr #{release_path}/solr"
      end
    end
  end

  desc 'start solr'
  task :start do
    on roles :app do
      within release_path do
        execute :rake, "sunspot:solr:start RAILS_ENV=#{fetch :stage}"
      end
    end
  end

  desc 'stop solr'
  task :stop do
    on roles :app do
      within release_path do
        execute :rake, "sunspot:solr:stop RAILS_ENV=#{fetch :stage};true"
      end
    end
  end

  desc 'reindex solr'
  task :reindex do
    on roles :app do
      within release_path do
        execute :rake, "sunspot:solr:reindex RAILS_ENV=#{fetch :stage};true"
      end
    end
  end
end

after 'deploy:check', 'sunspot:setup_solr_data_dir'

before 'deploy:publishing', 'sunspot:link_to_solr_shared_dirs'
before 'deploy:publishing', 'sunspot:reindex'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
h2ocube_rails_sunspot-0.0.3 lib/capistrano/tasks/sunspot.cap