Name: sul_pub
Owner: Stanford University Digital Library
Description: SUL system for harvest and managing publications for Stanford CAP, with controlled API access.
Created: 2016-05-25 17:58:18.0
Updated: 2018-05-22 04:05:05.0
Pushed: 2018-05-22 23:18:57.0
Homepage: http://cap.stanford.edu
Size: 11273
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
SUL Bibliographic Management System by Stanford University Libraries.
Configurations are currently being managed in multiple ways. The goal is to consolidate the approach. New configurations should be added in settings.yml
. Never check in private settings. This project uses the config gem for managing settings. Private settings can be added locally in a *.local.yml file. See Developer specific config files.
Legacy configuration files to review are:
This is a ruby on rails application with an rspec test suite. The ruby version currently used could be any version used in the .travis.yml configuration file (preferably the latest stable version). The application gems are managed by bundler, so the gem versions are all defined in the Gemfile (and Gemfile.lock).
The conventions to follow are noted in the DLSS developer playbook. The code style conventions are checked by rubocop, using the DLSS cops.
clone git@github.com:sul-dlss/sul_pub.git
ul_pub
le install
The application uses MySQL. Install MySQL, review config/database.yml
, and run some rake tasks to confirm everything is working, e.g.:
le exec rake db:create
le exec rake db:migrate
The test suite uses the VCR gem to manage HTTP request and response data. The configuration for VCR does not and should not allow new HTTP requests that are not managed by VCR. When any new specs require retrieval of data from subscription services, the private configuration files must be used (see below). Otherwise, the existing VCR cassettes should suffice.
To run the test suite:
necessary, use private configuration files.
le exec rake ci
To run specific tests, use rspec
directly, e.g.
n only the publications_api_spec:
S_ENV=test bundle exec rspec spec/api/publications_api_spec.rb
n only a subset of the publications_api_spec:
S_ENV=test bundle exec rspec spec/api/publications_api_spec.rb:157
This repository also uses the RSpec tag data-integration
to define tests that are reliant on external APIs. When creating data-integration
specs, make sure to add the RSpec tag 'data-integration': true
.
To run the data-integration
tests, make sure that your private credentials are appropriately configured. There is a convenient rake task to use for running the specs:
le exec rake spec:data-integration
There are private configuration data for this application, manged in a private github repository. These configuration files contain private credentials for access to subscription resources and for client access to the application API.
First, follow the instructions above for using private configuration files. Then run the test suite and commit any changes to the VCR cassettes.
e commands above for using private configuration files.
rf fixtures/vcr_cassettes/*
le exec rake ci
add fixtures/vcr_cassettes/
commit -m "Update VCR cassettes"
reset --hard # cleanup the private configuration files
The application is deployed using capistrano (see cap -T
for a list of available tasks). A developer can deploy the application when they have Kerberos authentication enabled for the remote user@host definition of the deployment target. The config/deploy
path in the private configuration files (see above) contains all the deployment target definitions, see:
le exec cap [ENVIRONMENT] shared_configs:update