Skip to content

Instantly share code, notes, and snippets.

@sophea
Created July 21, 2022 04:24
Show Gist options
  • Save sophea/0ff63f1f1102e23d0182d4a217389d7b to your computer and use it in GitHub Desktop.
Save sophea/0ff63f1f1102e23d0182d4a217389d7b to your computer and use it in GitHub Desktop.
pre-push
#!/bin/sh
#
# Run the following command in the root of your project to install this pre-push hook:
# cp git-hooks/pre-push .git/hooks/pre-push; chmod 700 .git/hooks/pre-push
# @author : Mak Sophea
# @version : 1.0
#
# get the path to this script file
DIR=$(dirname "$0")
if [ -s pom.xml ]; then
##build the project
echo "=============build phase with test package=============="
./mvnw clean test
if [[ $? != 0 ]]; then
echo -e "\e[32m>>>>>>>build test is not successful>>>....\e[0m"
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment