Skip to content

Commit

Permalink
Refactor rake task to make it possible to run jetty:config tasks from…
Browse files Browse the repository at this point in the history
… root of working directory
  • Loading branch information
Jon Stroop committed Jul 10, 2015
1 parent dcb1641 commit e9da326
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ To turn on virus detection, install clamav on your system and add the `clamav` g

If you are modifying the curation_concerns gem and want to run the test suite, follow these steps to set up the test environment.

```
$ rake engine_cart:generate
$ cd spec/internal
$ rake jetty:clean
$ rake curation_concerns:jetty:config
$ rake jetty:start
$ cd ../..
$ rake spec

```
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ require 'jettywrapper'
require 'engine_cart/rake_task'
Jettywrapper.hydra_jetty_version = "v8.3.1"

# This makes it possible to run curation_concerns:jetty:config from here.
import 'curation_concerns-models/lib/tasks/curation_concerns-models_tasks.rake'

task ci: ['engine_cart:generate', 'jetty:clean'] do
jetty_params = Jettywrapper.load_config
jetty_params[:startup_wait]= 90
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def banner
# Copy CurationConcerns's solrconfig into the dir from which the jetty:config task pulls
# CurationConcerns's solrconfig includes full-text extraction
def copy_solr_config
copy_file 'config/solrconfig.xml', 'solr_conf/conf/solrconfig.xml', force: true
src = File.join(__FILE__, '..', '..', '..', '..', '..', '..', 'solr_conf', 'conf', 'solrconfig.xml')
copy_file File.expand_path(src), 'solr_conf/conf/solrconfig.xml', force: true
end

# Copy config, schema, and jars into jetty dir if it exists
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
require 'net/http'

namespace :solr do
desc "Enqueue a job to resolrize the repository objects"
task reindex: :environment do
CurationConcerns.queue.push(ResolrizeJob.new)
end
end

namespace :curation_concerns do
namespace :jetty do

Expand Down
8 changes: 8 additions & 0 deletions curation_concerns-models/lib/tasks/solr_reindex.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace :curation_concerns do
namespace :solr do
desc "Enqueue a job to resolrize the repository objects"
task reindex: :environment do
CurationConcerns.queue.push(ResolrizeJob.new)
end
end
end
2 changes: 1 addition & 1 deletion curation_concerns.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "devise", "~> 3.0"
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "engine_cart", "~> 0.6"
spec.add_development_dependency "engine_cart", "~> 0.7"
spec.add_development_dependency "sqlite3"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "rspec-rails"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ def install_engine
def run_migrations
rake "db:migrate"
end

end

0 comments on commit e9da326

Please sign in to comment.