#!/bin/sh

/mit/sipb-www/git/zephyr-post-receive

# https://stackoverflow.com/questions/4043609/getting-fatal-not-a-git-repository-when-using-post-update-hook-to-execut
# who knows why they didn't need this workaround
unset GIT_DIR

# push changes to checkout folder
cd /mit/sipb-www/checkout
git fetch
git checkout master
git reset --hard origin/master

# build the website
# the build lock causes permissions issues
../hugo --noBuildLock=true # --destination=/mit/sipb-www/web_scripts/hugo

