Gitolite and Nikola, auto deploy

I am trying to test here, if the autodeploying with git and Nikola works. If it does, I will explain how it works. It seems like GIT_DIR and GIT_WORK_TREE play a big role like described here. Basically you should use a solution like this here.

This is how my script (post-hook) now looks like.

echo Building Nikola output directory..
export GIT_DIR="/home/git/repositories/"
export GIT_WORK_TREE="/home/"
echo "Checking out new files on server."
git checkout -f
echo "Building html-files.."
nikola build
echo "Making sure all rights are on read-access."
chmod -R a+rx output
echo "Done building Nikola output directory."