Find the ENV vars you forgot to add in your heroku config
This little script greps your Rails codebase looking for ENV
occurences and compares it to the output of heroku config
telling you which ENV
var is missing remotely.
#!/bin/bash
echo "These ENV variables only exist in the rails app but not in the heroku config"
echo
envs_in_rails() {
git grep "ENV\[" | sed "s/.*ENV\[['\"]\(.*\)['\"]\].*/\1/" | sort | uniq
}
envs_in_heroku() {
heroku config | sed "s/^\([A-Z][^:]*\):.*/\1/" | sort | uniq
}
comm -23 <(envs_in_rails) <(envs_in_heroku)
Written by Daniel Cadenas
Related protips
1 Response
Awesome \m/
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#