- Note: the Donut project is no longer in use. Please visit Meadow to see our current repository.
Donut is a Hydra head based on Hyrax
- Ruby >= 2.6
- Follow the Dev Environment Setup instructions
- Docker (we're using docker for mac: https://www.docker.com/docker-mac)
- Install
devstack
according to the instructions in the README - Geonames user registration
- The
geonames_username
key is defined in our shared configuration file.
- The
- Fits > 1.0.5
brew install fits
- Vips
brew install vips
-
Clone the Donut GitHub repository
-
Install Bundler (version that's in the
Gemfile.lock
) if it's not installed alreadygem install bundler -v "~>2.0.1"
] -
Install dependencies:
bundle install
-
Run
devstack up donut
in a separate tab to start dependency services -
Run
rake donut:seed
to initialize the stack.- Optional arguments to
donut:seed
(may be used in combination):bundle exec rake donut:seed ADMIN_USER=[your NetID] ADMIN_EMAIL=[your email]
to automatically add yourself an admin userbundle exec rake donut:seed ADMIN_USER=[your NetID] ADMIN_EMAIL=[your email] SEED_FILE=[path to YAML file]
to automatically add users and admin_sets. There is a sample seed file inspec/fixtures/files/test_seed.yml
- Optional arguments to
-
Create a fake AWS profile:
$ aws --profile fake configure
# enter dummy values for "AWS Access Key ID" and "AWS Secret Access Key".
# Set the "Default region name" to "us-east-1", use default[None] for format
# add this to your .zshrc, .bashrc, etc.
export AWS_PROFILE=fake
bundle exec rails s
Donut should be live at: https://devbox.library.northwestern.edu:3000/
You can stop the Phoneix server with Ctrl + C
You can stop devstack by running devstack down
. You local data (from the database, ldap, etc) will persist after devstack shuts down.
If you need to clear your data and reset the entire development environment, run devstack down -v
After initial setup, you don't need to run rake donut:seed...
again unless you've run devstack down -v
.
Read more about Devstack commands here.
Donut only wants "NUL Collection" types to be public. In order to make these available to the front-end React app:
- Go to
Dashboard > Settings > Collection Type
and add a "NUL Collection" collection type. - In
config/settings/development.local.yml
, add the gid of the "NUL Collection" collection type (or one you want to index in Elasticsearch). Ex:nul_collection_type: gid://nextgen/hyrax-collectiontype/3
. - Re-start the Rails server
Note: Only Donut collections of the collection type "NUL Collection" will appear in the front-end application.
More detailed information on Collection/Indexing setup here: Collection Type Indexing
Bring up the test stack in one window with:
$ devstack -t up donut
Run the SEED task for the test environment:
$ rake donut:seed RAILS_ENV=test
Run the test suite in another window:
$ rake spec
Or, you can run the test suite:
$ rake donut:ci
You can alternatively run rubocop and the specs independently with:
$ rake donut:ci:rubocop
$ rake donut:ci:rspec
Run Jasmine server:
$ rake jasmine
Run all tests:
$ http://localhost:8888
Run the javascript test suite:
$ rake jasmine:ci
- Run the
rake donut:seed
orrake s3:setup
rake task to create and populate the S3 bucket - Run the importer from the application root directory with the command:
$ bin/import_from_s3 dev-batch sample.csv
- Run the batch importer with the
seed-data.csv
file to load 30 sample records (this will take some time) - Make sure you have first run
bundle exec rake s3:setup
to populate the s3 bucket - Then run:
$ bin/import_from_s3 dev-batch seed-data.csv
the active elastic job gem requires an environment variable to be set otherwise all the specs fail. so run this first:
$ export PROCESS_ACTIVE_ELASTIC_JOBS=true
- You can replace
up
withdaemon
indocker:dev:up
anddocker:test:up
to run the Docker services in the background instead of in a separate tab. To stop the stack, use (for example)rake docker:dev:down
. - The test stack always cleans up its data when it comes down. To clean the dev stack, use
rake docker:dev:clean
.
- Run the development servers with
rake docker:dev:up
(ordaemon
) andrails s
- Go to https://devbox.library.northwestern.edu:3000/ and login
- To make the user who logged in an admin, run
rake donut:add_admin_role ADMIN_USER[your NetID]
- Go to https://devbox.library.northwestern.edu:3000/admin/workflow_roles and grant workflow roles if needed