Skip to content
Custom Blacklight instance for BC Library's Jesuit Bibliography project
Ruby HTML CSS XSLT Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
app
bin
config
db
lib
log
public
solr
test
tmp
vendor
.gitignore
.ruby-version
.solr_wrapper.yml
Capfile
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package.json

README.md

README

Development dependencies

Java

Rails requires Java version 8 or higher.

Be sure the JAVA_HOME environmental variable is set.

Postgres

Install

TK

Solr

Install

Install the most recent Solr 7.x version through the official package installer or through the local system package manager, e.g., brew.

Add new core

Once installed, add a new blacklight-core core.

solr create -c blacklight-core

Use custom solr config files

Copy the following config files to the blacklight-core directory.

cp /path/to/project/jesuit-bibligraphy/solr/blacklight-core/conf/* /path/to/solr/7.5.0/server/solr/blacklight-core/conf/

Then restart solr.

solr restart

Rails environmental variables

Add the following to your ~/.bashrc, ~/.profile or ~/.bash_profile file.

This only needs to be done once.

Add SECRET_KEY_BASE

echo 'export SECRET_KEY_BASE="abcdef...7890"' >> ~/.bash_profile

Add RAILS_ENV

echo 'export RAILS_ENV="development"' >> ~/.bash_profile

Activate the new environment variables in your current shell.

source ~/.bash_profile

Add SOLR_CONF_HOME

echo 'export SOLR_CONF_HOME="/path/to/solr/blacklight-core/conf"' >> ~/.bash_profile

Hint
if you used brew to install Solr then SOLR_CONF_HOME should be /usr/local/Cellar/solr/7.5.0/server/solr/blacklight-core/conf

Useful import commands for development

Drop the local database

rake db:drop

Rebuild the database with all the migrations

rake db:migrate

Import test users:

rake import:users

Warning
The import:pages task will create the static page records if they do not already exist. This task will not overwrite existing records.

Import default static pages

To load all the static 'About' pages into the app.

rake import:pages

Import test users and default static pages

rake import:all

Warning
All importdata tasks are interactive and will require user interaction to run.

Import set of sample records

rake importdata:books

rake importdata:book_chapters

Import all sample records (and create their citations)

rake importdata:all

Clear all Bibliograhy records

rake importdata:clear_all

Update local Solr instance with project config files (see this directory.)

rake solr_config:update

Restart local Solr instance

solr restart

Solr indexing

Use the Rails sunspot gem to index all the Bibliography records.

rake sunspot:reindex

Rebuild citations

We have a separate task to (re)build the citations for all citation records in the database.

Warning
This task will take a while to complete!

rake importdata:generate_citations

Going NUCLEAR

Want to completely clear out and restart your local development database? Run the following commands in succession:

rake solr_config:update
solr restart
rake db:drop
rake db:migrate
rake import:all
rake importdata:all
rake sunspot:reindex

Deployment

Make sure you have access to the production server. To deploy master to production:

cap production deploy
cap production deploy:solr:update    # if Solr config needs updating
cap production deploy:solr:reindex   # if Solr needs reindexing
cap production deploy:db:reset       # NO LONGER FUNCTIONAL! # if the database needs to be rebuilt
You can’t perform that action at this time.