pre-push hook:
set -eu
remote="$1"
url="$2"
BRANCH=`git branch | grep "^* [a-zA-Z]" | cut -c 3- `
# npm run lint && npm run jscs && npm run test &&
if [ $remote == 'origin' ]
then
make check
if [ $BRANCH == 'master' ] && [ $? == 0 ]
then
make push-mirrors
fi
fi
exit $?
with this make target:
GIT=git
push-mirrors:
$(GIT) push bitbucket-mirror
$(GIT) push gitlab-mirror
(and a check target that e.g. hints, tests, stylechecks)