emory-libraries / dlp-lux

Discovery for the DLP Cor Repository
2 stars 0 forks source link

CircleCI Test Coverage

README

Discovery application for Emory's Cor repository.

Running locally

  1. Install and start up MySQL 5.7
  2. Clone the git repo: git clone git@github.com:emory-libraries/dlp-lux.git
  3. cd ./dlp-lux
  4. Install the required gems: bundle install
  5. Configure the MySQL development and test databases. This is accomplished by setting the environment variables that database.yml expects. In the root directory of the application, create a .env file and add the line DATABASE_USERNAME=root. (By default, MySQL has the username root with no password.) Also create a .env.development file and a .env.test file and add the lines DATABASE_NAME=dlp-lux_development and DATABASE_NAME=dlp-lux_test, respectively.
  6. In order to be able to sign into the application locally, the environment variable DATABASE_AUTH=true must be set in your development environment.
    • You must create a user via the rails console:
      bundle exec rails c
      u = User.new
      u.uid = "user"
      u.display_name = "User Name"
      u.email = "email@testdomain.com"
      u.password = "password"
      u.password_confirmation = "password"
      u.save
  7. In order to see objects with a visibility of "Rose High View", your IP must match an address on the server in config/reading_room_ips.yml. See the existing file for the example setup.
  8. Create and migrate the development database: rails db:create db:migrate
  9. Create and migrate the test database: RAILS_ENV=test rails db:create db:migrate
  10. Migrate the database: rails db:migrate
  11. Install UV and any other JS dependencies: yarn install
  12. Launch development instance of solr: solr_wrapper
  13. Launch test instance of solr: solr_wrapper --config config/solr_wrapper_test.yml
  14. Run the tests to ensure everything is working as expected: rspec spec
  15. Launch a rails server: rails server
  16. You should now be able to go to http://localhost:3000 and see the application

Running in production

  1. The IIIF_MANIFEST_URL environment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's IIIF manifest. An example: https://curate-qa.curationexperts.com/concern/curate_generic_works/.
  2. The THUMBNAIL_URL environment variable needs to be set. This URL is the base URL for the Hyrax instance that serves the Work's thumbnail images. An example: https://curate-qa.curationexperts.com

HTTP Password protection in production mode

In order to prevent search engine crawling of the system before it's ready to launch, we use HTTP password protection. This is set via environment variables. Set HTTP_PASSWORD_PROTECT='true' to enable this feature. Set HTTP_PASSWORD_PROTECT='false' to disable this feature. Set the login and password via environment variables HTTP_USERNAME and HTTP_PASSWORD

Deploying to Emory servers

  1. To deploy, first connect to the Emory VPN.
  2. run tki and receive your 12-hour AWS credentials.
  3. run the following command:
    AWS_PROFILE=tki-aws-account-70-rhedcloud/RHEDcloudAdministratorRole BRANCH=<tag> bundle exec cap <env> deploy

    where <tag> is either a version, like v0.4.32, or a branch, like master and where <env> is one of production, test, or arch.

Running test suite

Run relevancy tests

Run blacklight performance tests

Run jmeter smoke test