psu-libraries/psulib_blacklight

View on GitHub
bin/startup

Summary

Maintainability
Test Coverage
#!/bin/bash
set -e
if [ -f /vault/secrets/config ]; then 
  echo "found vault config.. sourcing.."
  . /vault/secrets/config
fi

if [ "${RAILS_ENV:-development}" != "production" ]; then
  bundle check || bundle
fi

rm -f tmp/pids/server.pid

echo "migrating database"

bundle exec rails db:migrate

echo "initalizing solr"
bundle exec rake solr:initialize_collection

if [ "${LOAD_FIXTURES:-false}" == "true" ]; then
  echo "Loading Fixtures"
  bundle exec rake solr:load_fixtures
fi

echo "starting rails"

exec bundle exec rails s -b '0.0.0.0'