Last active
August 29, 2015 14:26
-
-
Save guyguyon/4403035fe92cd1260ef8 to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| branch=`git rev-parse --abbrev-ref HEAD` | |
| echo "Running tests before pushing...." | |
| if [[ $branch == 'master' || $branch == 'develop' ]]; | |
| then | |
| # SET IT TO YOUR OWN VIRTUALENV PATH ! | |
| source ~/virtualenv/mp_api/bin/activate | |
| root_path=`git rev-parse --show-toplevel` | |
| cd $root_path"/mp_api" | |
| ./manage.py test | |
| exit_code=$? | |
| cd - | |
| if [ $exit_code -gt 0 ] | |
| then echo "Did not push because of failing tests" | |
| else echo "Tests were passed successfully" | |
| fi | |
| exit $exit_code | |
| fi | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment