-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
71 lines (59 loc) · 1.7 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# frozen_string_literal: true
require "rails"
begin
require "bundler/setup"
require "bundler/gem_tasks"
rescue LoadError
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end
Bundler::GemHelper.install_tasks
require "solr_wrapper"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
require "rubocop/rake_task"
RuboCop::RakeTask.new(:rubocop)
require "solr_wrapper/rake_task"
require "engine_cart/rake_task"
require "geoblacklight_sidecar_images/version"
desc "Run test suite"
task ci: ["engine_cart:generate"] do
ENV["environment"] = "test"
# run the tests
Rake::Task["spec"].invoke
end
namespace :geoblacklight do
namespace :internal do
task seed: ["engine_cart:generate"] do
within_test_app do
system "bundle exec rake gblsci:sample_data:seed"
system "bundle exec rake geoblacklight:downloads:mkdir"
end
end
end
desc "Run Solr and seed with sample data"
task :solr do
if File.exist? EngineCart.destination
within_test_app do
system "bundle update"
end
else
Rake::Task["engine_cart:generate"].invoke
end
SolrWrapper.wrap(port: "8983") do |solr|
solr.with_collection(name: "blacklight-core", dir: File.join(File.expand_path(".", File.dirname(__FILE__)), "solr", "conf")) do
Rake::Task["geoblacklight:internal:seed"].invoke
within_test_app do
puts "\nSolr server running: http://localhost:#{solr.port}/solr/#/blacklight-core"
puts "\n^C to stop"
puts " "
begin
sleep
rescue Interrupt
puts "Shutting down..."
end
end
end
end
end
end
task default: %i[rubocop ci]