Skip to content

umass-gis/geoblacklight

Repository files navigation

UMass Amherst Portal for Geospatial Data

UMAP GeoData is the University of Massachusetts Amherst's GeoBlacklight instance, managed and hosted by the University Libraries.

Current Release Version

UMAP GeoData v1.1.1 / GeoBlacklight v4.1.


Dependencies

View the full GeoBlacklight release and technology dependency matrix here: Releases.

Setup

GoRails has great Ruby on Rails setup instructions for macOS, Ubuntu, and Windows. It goes through the general process to get up and running, but it doesn’t cover everything, and it may be preferable to install each dependency following separate tutorials.

Workflow to setup an M1 MacBook:

  1. Follow the latest documentation to install Homebrew.

  2. It's recommended to install Ruby on Rails with a version manager, like rbenv:

    brew install rbenv
    

    Then, ensure the version manager is loaded in your shell. For Macs using zsh, use nano ~/.zshrc to open the file and add the following lines of code:

    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init -)"
    

    Save, then restart with source ~/.zshrc.

  3. Install ruby, bundler, and rails (see this tutorial by Digital Ocean).

  4. Install node.js with brew install node. This should also install npm.

  5. Follow the latest documentation to install yarn. (You may need to install corepack if the first step in the yarn documentation fails. brew install corepack )

  6. Install java with brew install java, then follow the suggested commands to establish a symlink.

  7. Install mysql with brew install mysql, then start the database with brew services start mysql. Optionally, run the suggested commands to secure the database.

Configure GeoBlacklight

  1. Clone the project:

    cd <your project directory>
    git clone git@github.com:/umass-gis/geoblacklight.git
    
  2. Duplicate the .example files in the project and remove the .example string from each of their filename:

    cp .example.env.development .env.development  
    cp .example.env.test .env.test
    

    Then, update the MYSQL_USER and MYSQL_PASSWORD credentials in these files. These variables are called by database.yml when establishing a connection to the database.

  3. Navigate to the project directory and install the ruby gems with bundle install.

  4. Install the yarn packages with yarn install.

  5. Create and migrate the databases:

    Development environment:

    bundle exec rails db:create
    bundle exec rails db:migrate
    

    Test environment:

    RAILS_ENV=test bundle exec rails db:create
    RAILS_ENV=test bundle exec rails db:migrate
    

Run the Application

The rake task below will spin up Solr, index the test fixture documents, and start the default Rails web server.

bundle exec rake umass:server

Run the Test Suite

Stop any instances of GeoBlacklight before running this command.

RAILS_ENV=test bundle exec rake ci

Run the Rake Tasks for Solr

Delete all data from the Solr index

bundle exec rake umass:index:delete_all

Index just the UMass test fixtures

bundle exec rake rake umass:index:umass