Skip to content

Instantly share code, notes, and snippets.

@fofr
Created April 4, 2018 13:25
Show Gist options
  • Save fofr/b733b4826fb64e901f72705def400be1 to your computer and use it in GitHub Desktop.
Save fofr/b733b4826fb64e901f72705def400be1 to your computer and use it in GitHub Desktop.
Copy Heroku config variables
#!/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