rootstrap/rails_api_base

View on GitHub
bin/docker-entrypoint

Summary

Maintainability
Test Coverage
#!/bin/bash -e

# If running the rails server then create or migrate existing database
if ([ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]) || [ "${1}" == "./bin/dev" ]; then
  ./bin/rails db:prepare
fi

if [ "${1}" == "./bin/rspec" ] || [ $RAILS_ENV == "test" ]; then
  ./bin/rails db:test:prepare
fi

exec "${@}"