Skip to content

Instantly share code, notes, and snippets.

@jodell
Created August 9, 2012 19:22
Show Gist options
  • Save jodell/3307312 to your computer and use it in GitHub Desktop.
Save jodell/3307312 to your computer and use it in GitHub Desktop.
# sanity heroku_env
#
# FIXME: Need a better way to 'prime' the app before doing a sanity check.
# When done, 503 should be removed from the set of valid http codes.
#
sanity() {
echo "Checking http://$1.herokuapp.com"
curl -s -S -L http://$1.herokuapp.com -o /dev/null -m 500 --retry 5 --retry-delay 8 -w '%{http_code}' \
| tee -a /tmp/heroku.out | grep -q '200\|401\|400\|503' || (echo "$1 deploy may have failed!" && exit 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment