Blacklightify a CONTENTdm collection
- Ruby (3.1)
- Ruby on Rails (6.1)
- Java Runtime Environment (JRE) version 1.8 for Solr
- ImageMagick (http://www.imagemagick.org/script/index.php) due to carrierwave
- Oniguruma for
ruby-jq
bindings, used by fast solr export (brew install oniguruma
,apt-get install libonig-dev
,yum install oniguruma-devel
) - Redis for sidekiq
- Git-flow branching workflow tools (Installation docs)
- Clone the repository
$ git clone git@github.com:UMNLibraries/cdm-blacklightify.git cdm-blacklightify
$ cd cdm-blacklightify
- Setup git-flow
$ git flow init
Choose branches (accept defaults):
- Release branch:
main
- Next release development branch:
develop
- Feature branch prefix:
feature/
- Hotfix prefix:
hotfix/
- Release prefix:
release/
- Support prefix:
support/
- Version tag prefix: (leave blank)
- bundle dependencies
$ bundle install
- Configure DotEnv files
$ cp .env.example .env
Fill in missing env var values (@TODO: share via LastPass?)
- Prepare development database
Build the project database tables and load our test fixtures for development use.
$ bundle exec rails db:migrate
$ bundle exec rails db:fixtures:load
- Start development services via
foreman
. This will result in Redis being downloaded, compiled, and started up intmp/
, Solr being download and/or started viasolr_wrapper
using the config at.solr_wrapper.yml
, Sidekiq queuing service starting, and finally, the Rails development web server.
$ bundle exec foreman start
OPTIONAL: Starting some services independently is possible if a fast startup is desired, especially when the Sidekiq job queue won't be needed.
# Start solr without the whole foreman suite
$ bundle exec solr_wrapper --config .solr_wrapper.yml
# Start Rails/Puma without the whole foreman suite
# (port 3000, limited to only the local network interface)
$ bundle exec rails server -b 127.0.0.1 -p 3000
Visit http://localhost:3000 in your browser to see your locally running instance
- For development, a test record set can be quickly loaded from a stored JSON
fixture. This will load
test/fixtures/dev_solr_harvest.json.gz
directly into Solr. NOTE This will erase your current index.
$ bundle exec rake umedia:solr:index_dev
- Assuming Redis and Sidekiq are running (started with
foreman
), run Harvest rake task
$ bundle exec rake umedia:index:harvest_dev
- (Optional) Commit to Solr
As your harvest is running, you can occasionally sent a commit
to Solr to see what documents you have harvested.
$ bundle exec rake umedia:index:commit
# Store all thumbs
$ bundle exec umedia:thumbnails:store
# Store specific thumbs by doc id, space separated
$ DOC_IDS='p16022coll262:172 p16022coll262:173' bundle exec rake umedia:thumbnails:store
# Purge all thumbs
$ bundle exec umedia:thumbnails:purge
# Purge thumbs by doc id, space separated
$ DOC_IDS='p16022coll262:172 p16022coll262:173' bundle exec rake umedia:thumbnails:purge
- Moving Image / http://localhost:3000/catalog/p16022coll262:494
- Still Image / http://localhost:3000/catalog/p16022coll208:2288
- Sound / http://localhost:3000/catalog/p16022coll171:610
- Text / http://localhost:3000/catalog/p16022coll282:5610
- Kaltura Audio Playlist / http://localhost:3000/catalog/p16022coll171:3715