Last active
August 29, 2015 14:26
-
-
Save xjunior/b0914dc504476f96b25a to your computer and use it in GitHub Desktop.
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 | |
config_list() { | |
config_list=$(mktemp -t configlist) | |
show_value=false | |
longest_line=10 | |
[ "$1" == "-v" ] && show_value=true && shift | |
args=("$@") | |
for appi in "${!args[@]}"; do | |
if $show_value; then | |
heroku config --app ${args[$appi]} | sort | |
else | |
heroku config --app ${args[$appi]} | cut -d ':' -f 1 | sort | |
fi > $config_list.$appi | |
curr_longest=$(cat $config_list.$appi | awk '{ print length }' | sort -n | tail -1) | |
[ "$curr_longest" -gt "$longest_line" ] && longest_line="$curr_longest" | |
done | |
pr -w $(($longest_line * 2)) -m -t $config_list.* | |
rm $config_list.* | |
} | |
config_list $* |
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
$ compare-config -v app1 app1-staging | |
=== app1 Config Vars === app1-staging Config Vars | |
MMYSQL_DATABASE: mysql://staging-user:[email protected] MMYSQL_DATABASE: mysql://staging-user:[email protected] | |
FEATURE_ENABLED: false FEATURE_ENABLED: true | |
SERVICE_KEY_ID: AKI43DW4XFD16JONFE2Q SERVICE_KEY_ID: IKD9ON2T999KIAIDK1XA | |
SERVICE_ACCESS_KEY: DFS1PGC9eICquUZjiid9sKZC9123 SERVICE_ACCESS_KEY: DFSPGC9e4ICquUZjiid9sKZC9123 | |
$ compare-config app1 app1-staging | |
=== app1 Config Vars === app1-staging Config Vars | |
MMYSQL_DATABASE MMYSQL_DATABASE | |
FEATURE_ENABLED FEATURE_ENABLED | |
SERVICE_KEY_ID SERVICE_KEY_ID | |
SERVICE_ACCESS_KEY SERVICE_ACCESS_KEY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment