Created
August 1, 2017 06:17
-
-
Save rduque1/4d0ce702cd0dee23492adf2a8b1528ed to your computer and use it in GitHub Desktop.
Heroku copy env vars
This file contains 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 | |
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
set -e | |
sourceApp="$1" | |
targetApp="$2" | |
while read key value; do | |
key=${key%%:} | |
echo "Setting $key=$value" | |
heroku config:set "$key=$value" --app "$targetApp" | |
done < <(heroku config --app "$sourceApp" | sed -e '1d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment