Skip to content

sul-dlss/suri-rails

Repository files navigation

Build Status Test Coverage Maintainability Docker image OpenAPI Validator

SURI

SURI is the Stanford Unique Resource Identifier service. It mints unique identifiers (e.g., DRUIDs).

SURI has an OpenAPI 3.0 spec that documents the API in openapi.yml. You can browse the generated documentation at http://sul-dlss.github.io/suri-rails/.

Requirements

  1. Ruby (3.2.0 or greater)

Installation

Clone the repository

$ git clone [email protected]:sul-dlss/suri-rails.git

Change directories into the app and install dependencies

$ bundle install

Start the development server

$ rails s

Testing

First, ensure the database container is spun up:

$ docker compose up db # use -d to daemonize/run in background

And if you haven't yet prepared the test database, run:

$ bin/rails db:setup

The test suite (with RuboCop style enforcement) will be run with the default rake task (also run on CI).

$ bin/rake

The specs can be run without RuboCop enforcement

$ bin/rake spec

The RuboCop style enforcement can be run without running the tests

$ bin/rake rubocop

Building for Docker

Spin up the application and its database:

$ docker compose up --build

Updating Docker Image

Note that CI is configured to automatically update the image hosted on DockerHub on every commit to main. If you want to build and push an image manually, run:

$ docker build -t suldlss/suri-rails:latest .
$ docker push suldlss/suri-rails:latest