OregonDigital Hydra Application
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci Fix/update ruby vips (#1220) Apr 17, 2018
app Merge pull request #1202 from OregonDigital/fix/oembed_url Oct 9, 2017
batch Add batch directory for docker Feb 1, 2017
bin Fix/update ruby vips (#1220) Apr 17, 2018
config Remove X-Frame-Options as default header. Feb 23, 2018
db Fix/update vips (#1210) Jan 18, 2018
docker use ruby-vips with fix for centos (#1222) Jun 19, 2018
fedora_conf/conf fedora_conf changes Mar 24, 2016
jetty @ 1edb90e fedora 3.8.1 Mar 24, 2016
lib Fix/update vips (#1210) Jan 18, 2018
log initial commit Jul 18, 2013
phantombin Set up docker for development and testing Oct 10, 2016
public Fixes #333 Oct 3, 2017
script initial commit Jul 18, 2013
solr_conf Set up docker for development and testing Oct 10, 2016
spec Fix/update vips (#1210) Jan 18, 2018
test initial commit Jul 18, 2013
vendor Remove bookreader's embedded navbar init Jul 30, 2018
.dockerignore Ignore various huge directories from docker builds Feb 8, 2017
.gitattributes Make word diffs better in git Jan 15, 2014
.gitignore First attempt at Circle Apr 6, 2015
.gitmodules fix jetty submodule May 17, 2016
.rspec Set up testing environment. Sep 11, 2013
.rubocop.yml rubocop configuration for style validatition Sep 11, 2013
.travis.yml 2.1.3 for testing. Oct 24, 2014
CONTRIBUTING.md First pass at CONTRIBUTING.md Jan 1, 2015
Capfile Track deployments with new relic so we know if this helped. Apr 7, 2014
Gemfile use ruby-vips with fix for centos (#1222) Jun 19, 2018
Gemfile.lock use ruby-vips with fix for centos (#1222) Jun 19, 2018
Guardfile Ignored jetty for GUARD. Sep 12, 2013
LICENSE Added period to end sentence. Feb 23, 2015
README.md Added note about Mongo, and version 2.4 Nov 14, 2017
README.rdoc initial commit Jul 18, 2013
Rakefile Added resque-retry. Jan 13, 2015
Vagrantfile Needed more ram to use spring. Sep 8, 2014
config.ru initial commit Jul 18, 2013
docker-compose.yaml Shim RAIS into the docker setup for DZI Feb 14, 2017
test-compose.yaml Make `docker-compose up` work right Jan 23, 2017

README.md

OregonDigital

Circle CI Coverage Status

Overview

Current production Oregon Digital running Fedora 3 and Hydra 6.

New development is focused on Oregon Digital 2: http://github.com/OregonDigital/oregondigital_2

Connected projects:

Local Development Setup

Using Docker

Grab everything you need

# Grab the repository
git clone git@github.com:OregonDigital/oregondigital.git

# Start the whole stack - on your first run, this can take a while to download
# all the necessary images
docker-compose up -d

Making zoomable images work

Create config/app.yml with information about how to reach your local system's RAIS container; e.g.:

iip_server:
  location: http://localhost:12415/images/dzi

You may need to choose something other than localhost if you're doing a demo or running docker inside a virtual machine. The rest of the settings (port and path) should remain untouched.

Generate filler data

First, run the rake task:

docker-compose exec workers bundle exec rake filler_data

Next, log into the main application by browsing to http://localhost:3000/users/sign_in. Docker sets up the admin user as "admin@example.org" with the password "admin123". Once you're signed in, visit http://localhost:3000/resque/overview and watch the queue slowly get processed. This can take a while, but once it's done you should have 3 collections of dummy data.

Testing

Easy as ./docker/test.sh! Except....

  • Want to focus tests? Just pass in a path: ./docker/test.sh spec/models.
  • If you need to ensure your environment is pristine, use the --destroy flag, which will destroy and rebuild all containers.

Updating Gems

The safest way to update gems is to destroy and rebuild the dev image, otherwise you're only updating gems within a container, and containers do not necessarily persist very long.

docker-compose stop
docker-compose rm
docker rmi oregondigital/od1-dev
docker-compose build workers

You can also run "bundle install" inside a particular container, but this should only be done if you know what you're doing. It can get really confusing when you accidentally use docker-compose run when you meant docker-compose exec. Or if you choose the wrong container name.

Various other docker stuff

This list of commands should get you moving forward with most typical development tasks:

# When you change code, if you start getting odd errors, you may have to
# restart the OD containers:
docker-compose restart web workers resquehead

# If things are still "weird", rebuild the OD containers:
docker-compose stop web workers resquehead
docker-compose rm web workers resquehead
docker-compose build web workers resquehead
docker-compose up -d

# If you need a "hard reset", nuke it!  WARNING: THIS WILL REMOVE ALL YOUR
# DEVELOPMENT-INGESTED ASSETS!
./docker/nuke.sh

# When nukes just don't destroy enough, try out a SUPERNOVA!  This will remove
# every Docker entity related to OD, which will mean re-downloading the images:
./docker/supernova.sh

# Watch the logs for everything
docker-compose logs -f

# Just watch the Rails web app logs
docker-compose logs -f web

Manual

Requires Ruby 2.0

(Mongo needs to be running, 2.4 is known to work: https://docs.mongodb.com/v2.4/tutorial/install-mongodb-on-ubuntu/ )

git clone git@github.com:OregonDigital/oregondigital.git
cd oregondigital
bundle install
rake db:migrate
git submodule init
git submodule update
rake hydra:jetty:config

On a newer install, may have to pin

Symlink media directories:

ln -s /path/to/rails/media public/media
ln -s /path/to/rails/media/thumbnails public/thumbnails

Install memcached if needed, or make sure it's running (needed for login sessions):

Start the servers:

rake jetty:start
rails server

Vagrant Setup

Requires Git, VirtualBox, and Vagrant. Also requires 3 gigs of RAM to be available for the VM which vagrant creates.

Option 1: manual submodule setup:

git clone git@github.com:OregonDigital/oregondigital.git
cd oregondigital
git submodule init
git submodule update

Option 2: automatic submodule setup:

git clone git@github.com:OregonDigital/oregondigital.git --recursive
cd oregondigital

Either way, you then tell vagrant to download and start the virtual machine:

vagrant up
vagrant ssh

After vagrant ssh you'll be logged into the VM. From there, you'll want to start the Rails server:

cd /vagrant
rails server

You can browse the app via http://localhost:3000, and check on the jetty container (which houses solr and fedora) at http://localhost:8983.