Created
March 1, 2014 19:59
-
-
Save kevinmartin/9296215 to your computer and use it in GitHub Desktop.
Project Environment Variables to Branch Environment Variables - For Heroku Deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRANCH=${CIRCLE_BRANCH^^} | |
HEROKU_APP=$BRANCH"_HEROKU_APP" | |
AMP_ENV=$BRANCH"_AMP_ENV" | |
EMAIL=$BRANCH"_EMAIL" | |
REDIS_HOST=$BRANCH"_REDIS_HOST" | |
COOKIE_DOMAIN=$BRANCH"_COOKIE_DOMAIN" | |
L10N=$BRANCH"_L10N" | |
DB_DATABASE=$BRANCH"_DB_DATABASE" | |
DB_USERNAME=$BRANCH"_DB_USERNAME" | |
DB_PASSWORD=$BRANCH"_DB_PASSWORD" | |
DB_HOST=$BRANCH"_DB_HOST" | |
DB_PORT=$BRANCH"_DB_PORT" | |
DOMAINS=$BRANCH"_DOMAINS" | |
git remote add heroku [email protected]:${!HEROKU_APP}.git | |
git fetch heroku | |
git push heroku $CIRCLE_SHA1:refs/heads/master | |
heroku config:set \ | |
AMP_ENV=${!AMP_ENV} \ | |
EMAIL=${!EMAIL} \ | |
REDIS_HOST=${!REDIS_HOST} \ | |
COOKIE_DOMAIN=${!COOKIE_DOMAIN} \ | |
L10N=${!L10N} \ | |
DB_DATABASE=${!DB_DATABASE} \ | |
DB_USERNAME=${!DB_USERNAME} \ | |
DB_PASSWORD="${!DB_PASSWORD}" \ | |
DB_HOST=${!DB_HOST} \ | |
DB_PORT=${!DB_PORT} \ | |
DOMAINS=${!DOMAINS} \ | |
BUILD_NUMBER=$CIRCLE_SHA1 \ | |
--app ${!HEROKU_APP} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment