Skip to content

Testing gitolite, stash update hooks (proposal)

Kevin van Zonneveld edited this page Jan 10, 2014 · 2 revisions

For testing server hooks we can make bare repository (TESTREPODIR) and clone by local path to TESTCLONEDIR and we can test git push and error output.

git init --bare
cp -af "${__DIR__}/update" "hooks/update" && chmod 755 "${_}"
git clone ${TESTREPODIR} ${TESTCLONEDIR}
cd ${TESTCLONEDIR}
echo "<?php echo '123';" > ${TESTCLONEDIR}/testSuccess.php
git add ${TESTCLONEDIR}/testSuccess.php
git commit -m "Test success php"
git push
echo "<?php echo '123'" > ${TESTCLONEDIR}/testFail.php
# php -l ${TESTCLONEDIR}/testFail.php
git add ${TESTCLONEDIR}/testFail.php
git commit -m "Test fail php" -n
git push
Clone this wiki locally