script: test enforced push to master

enforced building and test with a pre-push hook
IMPORTANT: cmake is needed in PATH
This commit is contained in:
Andreas Stallinger
2016-03-07 16:58:57 +01:00
parent fec17e452d
commit d431161fbb
9 changed files with 129 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
BRANCH_NAME=$(git symbolic-ref -q --short HEAD)
if [ -z $BRANCH_NAME ]
then
echo -e $ABORT "You are not on any branch."
exit 1
fi
if [ $BRANCH_NAME == "master" ]
then
echo -e $ABORT "Commiting to master is prohibited."
exit 1
fi
if [ $BRANCH_NAME == "public_beta" ]
then
echo -e $ABORT "Commiting to public_beta is prohibited."
exit 1
fi
exit 0