Last active
March 1, 2021 03:45
-
-
Save swarawan/d28ebf8655ef9690792678de5c84cc64 to your computer and use it in GitHub Desktop.
Git pre-commit hook to run maven test
This file contains 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
echo "========== Hook: Run Maven Test ==========" | |
# run maven test | |
mvn clean test | |
if [ $? -ne 0 ]; then | |
echo "========= Hook: Error While Testing The Code ==========" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to do:
.git/hooks
directorysudo chmod +x pre-push
to make it executableDone.