Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created February 5, 2016 08:26
Show Gist options
  • Save toast38coza/6f18c964685168dabfb2 to your computer and use it in GitHub Desktop.
Save toast38coza/6f18c964685168dabfb2 to your computer and use it in GitHub Desktop.
pre-push hook. Run django tests inside docker before pushing
#!/bin/bash
docker-compose run web python manage.py test
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo ""
echo ""
echo "\******************"
echo "Oh hell no!"
echo "The tests have failed. Cancelling push"
echo "------------------"
echo "If you _really_ want to push this code push with the --no-verify switch"
echo ""
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment