BenMusch/nu-tab

View on GitHub
bin/setup_review_app

Summary

Maintainability
Test Coverage
#!/bin/sh
 
# Run this script to set up a review app's database and worker dyno
 
set -e
 
if [ -z "$1" ]; then
printf "You must provide a review app (same as the pull request) id.\n"
exit 64
fi
 
PARENT_APP_NAME=nu-tab-staging
APP_NAME=nu-tab-staging-pr-$1
URL=`heroku pg:backups public-url -a $PARENT_APP_NAME`
 
heroku pg:backups restore $URL DATABASE_URL --confirm $APP_NAME --app $APP_NAME
heroku run rake db:migrate --exit-code --app $APP_NAME
heroku ps:scale worker=1 --app $APP_NAME
heroku restart --app $APP_NAME