Created
December 20, 2017 16:22
-
-
Save ryanwilsonperkin/e671ffbaa046bda596eea8767f4a5b34 to your computer and use it in GitHub Desktop.
Check all applications in a convox rack for environment variables (name or value) containing a search_query
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
rack=$1 | |
search_query=$2 | |
if [ -z "$rack" ] || [ -z "$search_query" ]; then | |
echo "usage: $0 rack search_query" | |
exit 1 | |
fi | |
apps=$(convox apps --rack $rack | grep -v STATUS | cut -f1 -d' ') | |
for app in $apps | |
do | |
results=$(convox env --app $app --rack $rack | grep $search_query) | |
if [ -n "$results" ] | |
then | |
for result in $results | |
do | |
echo $rack:$app:$result | |
done; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
./convox_env_check.sh prod foobar
Returns: