Skip to content

Instantly share code, notes, and snippets.

@rafaelhenrique
Created July 26, 2018 14:51
Show Gist options
  • Save rafaelhenrique/db07ed64fff63ccb2d4bc126deda0141 to your computer and use it in GitHub Desktop.
Save rafaelhenrique/db07ed64fff63ccb2d4bc126deda0141 to your computer and use it in GitHub Desktop.
Find configuration on Heroku
#!/bin/bash
# Config to find on heroku
CONFIG=$(echo $CONFIG)
if [ -z $CONFIG ]; then
echo "Syntax error! CONFIG=<config to find> $0"
exit 1
fi
ALL_APPS=( $(heroku apps -A| awk '($1 !~ "==") {print $1}') )
for((cont=0; cont<${#ALL_APPS[@]}; cont++)); do
APP=${ALL_APPS[$cont]}
heroku config -a $APP | grep $CONFIG
if [ $? -eq 0 ]; then
echo "Config is here! $APP"
fi
done
@rafaelhenrique
Copy link
Author

Example...

Locate "Hello" configuration from apps:

CONFIG=Hello ./find_config.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment