Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check all applications in a convox rack for environment variables (name or value) containing a search_query
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
@ryanwilsonperkin

This comment has been minimized.

Copy link
Owner Author

ryanwilsonperkin commented Dec 20, 2017

Usage: ./convox_env_check.sh prod foobar
Returns:

prod:application_1:ENV_VAR_NAME=foobar
prod:application_1:OTHER_ENV_VAR=there once was a foobar
prod_application_2:ENV_VAR_NAME=foobar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.