Skip to content

Instantly share code, notes, and snippets.

@Ulv
Created December 10, 2013 09:20
Show Gist options
  • Save Ulv/7887899 to your computer and use it in GitHub Desktop.
Save Ulv/7887899 to your computer and use it in GitHub Desktop.
phpunit tests on git post-update hook (push in master)
#!/usr/bin/env bash
TEST_PATH='/home/ulv/PhpstormProjects/kinetic/oncologytest/tests/'
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
phpunit $TEST_PATH
rc=$?
if [[ $rc != 0 ]] ; then
exit $rc
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment