#!/usr/bin/env sh if git remote | grep heroku > /dev/null; then git push heroku master else read -p "Please provide Heroku application name: " APP_NAME if [ APP_NAME == "" ]; then echo "¯\_(ツ)_/¯" exit 1 fi heroku create "${APP_NAME}" heroku git:remote -a "${APP_NAME}" heroku config:set SMTP_ADDRESS=smtp.sendgrid.net \ SMTP_DOMAIN=heroku.com \ SMTP_PASSWORD=placeholder \ SMTP_USERNAME=placeholder \ HOST="${APP_NAME}.herokuapp.com" heroku addons:create mongolab heroku addons:create sendgrid:starter SENDGRID_USERNAME=$(heroku config:get SENDGRID_USERNAME) SENDGRID_PASSWORD=$(heroku config:get SENDGRID_PASSWORD) MONGOLAB_URI=$(heroku config:get MONGOLAB_URI) heroku config:set SMTP_USERNAME="${SENDGRID_USERNAME}" \ SMTP_PASSWORD="${SENDGRID_PASSWORD}" \ MONGODB_URI="${MONGOLAB_URI}" git push heroku master heroku run rake db:seed echo "Done" fi