Bruin Bear (statue) In 1984 to mark its 50th Anniversary, the UCLA Alumni Association commissioned "Mighty Bruins" and presented the Bruin Bear Statue to the university. The statue is now a campus landmark and a focal point in Westwood Plaza.
This section gives basic instructions to get Ursus running locally. More extensive developer documentation is maintained in the wiki.
Ursus is a Blacklight application and only needs Solr and MySQL.
Ursus can run locally in two ways:
- Stand alone mode
- In conjunction with local instance of Californica
The file docker-compose-standalone.yml
includes a setup with a clone of the ursus-stage and sinai-stage solr indexes, so you do not need to run californica and manually ingest material (in fact, californica should #not# be running to avoid port conflicts.)
git clone [email protected]:UCLALibrary/ursus.git
cd ursus
docker-compose run web bundle exec rails db:setup
docker-compose run web bundle exec rails db:setup
Could not find rails_autolink-1.1.8 in any of the sources
Run `bundle install` to install missing gems.
- Running this command
docker-compose up --build
** Then run the following command again
docker-compose run web bundle exec rails db:setup
** Do this after setting up the databases** - the startup scripts require the database to be ready so that they can set feature flags e.g. for the Sinai UI mode.
docker-compose up
- Ursus / UCLA Library Digital Collections UI is enabled on port 3003
The data you're viewing is coming from a solr instance, preloaded with data from [Californica-test] (https://californica-test.library.ucla.edu), and should not need to be changed in most cases, since Ursus is a discovery interface only. You can view the solr console on port 8983.
Connect to a shell inside the container with:
docker-compose run web bash
Then run the entire suite, except for the cypress integration test, with:
sh start-ci.sh
You can inspect the start-ci.sh
script to see which linters and tests this invokes.
Or individually:
- root@ursus:/ursus# bundle exec erblint --lint-all
- root@ursus:/ursus# yarn run lint
- root@ursus:/ursus# rubocop
Go to the docker.env
file for directions
-
Comment out
SOLR_URL=http://solr:8983/solr/ursus
-
Uncomment this line
SOLR_URL=http://host.docker.internal:8983/solr/californica
-
In your terminal run $
docker-compose -f docker-compose-with-californica.yml up
-
Be sure to comment out
SOLR_URL=http://host.docker.internal:8983/solr/californica
-
And uncomment this line
SOLR_URL=http://host.docker.internal:8983/solr/californica
Here's how you can do it using Docker and Docker Compose commands.
docker-compose exec db bash
mysql -u root
USE ursus_development;
SHOW TABLES;
DESCRIBE users;
DESCRIBE searches;
select * from searches;
exit;
Rails Console: For Rails-specific data inspection or manipulation, you can also use the Rails console. Run docker-compose exec web rails console to access it. This is particularly useful for operations that involve Rails models.
- To run the Rake task, open a terminal, navigate to the root of your Rails application, and execute:
docker-compose run web bash
rake blacklight:clear_tables
- Or, if you are using Rails 5.1 or later, you should use the rails command instead:
docker-compose run web bash
rails blacklight:clear_tables
First, you will need to install node.js and npm locally.
Then cd into the e2e
directory and install the javascript dependencies:
cd e2e
npm install
Next, you can either open the cypress test runner GUI with:
npx cypress open
or run the tests in the command line:
npx cypress run
Visual regression testing is done via percy.io. This runs only for pull requests on travis; it will not run locally.
If you need to rebuild the docker image (for example, if packages were added to the Gemfile), run:
docker-compose pull
docker-compose up --build