Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Updating README and rake tasks for Solr 5
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Feb 19, 2016
1 parent b47f4b5 commit d3f9dd1
Show file tree
Hide file tree
Showing 10 changed files with 447 additions and 233 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
/tmp
noid-minter-state

/jetty
/fcrepo4-development-data
/fcrepo4-test-data
/fits
/coverage
/staged_files
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'pry-byebug'
gem 'rspec-rails'
gem 'jettywrapper'
gem 'solr_wrapper', '~> 0.4'
gem 'fcrepo_wrapper', '~> 0.2'
gem "factory_girl_rails"
gem 'jasmine-rails'
gem 'jasmine-jquery-rails'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ GEM
railties (>= 3.0.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
fcrepo_wrapper (0.2.1)
ruby-progressbar
ffi (1.9.10)
font-awesome-rails (4.5.0.0)
railties (>= 3.2, < 5.0)
Expand Down Expand Up @@ -727,6 +729,9 @@ GEM
httparty (>= 0.11.0)
oauth2 (>= 0.9.2)
slop (3.6.0)
solr_wrapper (0.5.0)
ruby-progressbar
rubyzip
solrizer (3.3.0)
activesupport
daemons
Expand Down Expand Up @@ -822,6 +827,7 @@ DEPENDENCIES
devise-guests (~> 0.3)
ezid-client
factory_girl_rails
fcrepo_wrapper (~> 0.2)
hydra-collections!
hydra-derivatives!
hydra-pcdm!
Expand Down Expand Up @@ -858,6 +864,7 @@ DEPENDENCIES
sdoc (~> 0.4.0)
sidekiq
simplecov (~> 0.9)
solr_wrapper (~> 0.4)
spring
sprockets-es6
sprockets-rails (~> 2.3.3)
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@

## Running the Code

Setup dependencies and run the test servers in one window:

$ bundle install
$ rake jetty:clean
$ rake curation_concerns:jetty:config
$ rake jetty:start
$ rake db:migrate
$ rake server:test

Run the test suite in another window:

$ rake spec

## Adding an Admin user

1. Run the development servers with `rake server:development`
1. Run Plum with `rails s`
1. Go to http://localhost:3000/users/auth/cas and login with CAS
1. $ rake add_admin_role
Expand Down
32 changes: 31 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require 'bundler/setup'
require 'rubocop/rake_task'
require 'jettywrapper'
require 'solr_wrapper'
require 'fcrepo_wrapper'

require File.expand_path('../config/application', __FILE__)

Expand Down Expand Up @@ -30,6 +31,35 @@ task ci: ['jetty:clean'] do
fail "test failures: #{error}" if error
end

namespace :server do
desc 'Run Fedora and Solr for development environment'
task :development do
run_server 'development', solr_port: 8983, fcrepo_port: 8984
end

desc 'Run Fedora and Solr for test environment'
task :test do
run_server 'test', solr_port: 8985, fcrepo_port: 8986
end
end

def run_server(environment, solr_port: nil, fcrepo_port: nil)
solr_params = { port: solr_port, verbose: true, managed: true }
fcrepo_params = { port: fcrepo_port, verbose: true, managed: true,
enable_jms: false, fcrepo_home_dir: "fcrepo4-#{environment}-data" }
SolrWrapper.wrap(solr_params) do |solr|
solr.with_collection(name: environment, dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr_conf', 'conf')) do
FcrepoWrapper.wrap(fcrepo_params) do
puts "\n#{environment.titlecase} servers running:\n"
puts " Fedora..: http://localhost:#{fcrepo_port}/rest/"
puts " Solr....: http://localhost:#{solr_port}/solr/#{environment}/"
puts "\n^C to stop"
sleep
end
end
end
end

task default: :ci

Rails.application.load_tasks
6 changes: 3 additions & 3 deletions config/blacklight.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
development:
adapter: solr
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/development" %>
url: <%= ENV['SOLR_URL'] || "http://localhost:8983/solr/development" %>
test: &test
adapter: solr
url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/solr/test" %>
url: <%= "http://localhost:#{ENV['TEST_JETTY_PORT'] || 8985}/solr/test" %>
production: &production
adapter: solr
url: <%= ENV['PLUM_SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %>
url: <%= ENV['PLUM_SOLR_URL'] || "http://localhost:8983/solr/blacklight-core" %>
staging:
<<: *production
6 changes: 3 additions & 3 deletions config/fedora.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
development:
user: fedoraAdmin
password: fedoraAdmin
url: http://127.0.0.1:8983/fedora/rest
url: http://localhost:8984/rest
base_path: /dev
test:
user: fedoraAdmin
password: fedoraAdmin
url: http://localhost:8983/fedora/rest
url: http://localhost:8986/rest
base_path: /test
production: &production
user: <%= ENV["PLUM_FEDORA_USER"] || "fedoraAdmin" %>
password: <%= ENV["PLUM_FEDORA_PASS"] || "fedoraAdmin" %>
url: <%= ENV["PLUM_FEDORA_URL"] || "http://127.0.0.1:8983/fedora/rest" %>
url: <%= ENV["PLUM_FEDORA_URL"] || "http://localhost:8984/rest" %>
base_path: /prod
staging:
<<: *production
Expand Down
2 changes: 1 addition & 1 deletion config/solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
development:
url: http://localhost:8983/solr/development
test:
url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/solr/test" %>
url: <%= "http://localhost:#{ENV['TEST_JETTY_PORT'] || 8985}/solr/test" %>
production: &production
url: <%= ENV["PLUM_SOLR_URL"] %>
staging:
Expand Down
Loading

0 comments on commit d3f9dd1

Please sign in to comment.