I've setup GitLab and am using it to host my Git repositories. Now what I'm trying to do is setup a post-receive
hook so that I can develop in a folder called site_dev
then push my changes so they're automatically pulled into the site
folder.
All morning I've been trying to get this hook to work however I've not had any luck executing any commands with GitLab running on Ubuntu Server, I know that the resque
service is running and my workers are active.
Currently I have:
#!/bin/bash
LIVE="/var/www/teamnet"
# read oldrev newrev refname
# if [ $refname = "refs/heads/master" ]; then
echo "===== DEPLOYING TO LIVE SITE ====="
cd $LIVE || exit
unset GIT_DIR
git pull
echo "===== DONE ====="
# fi
Attempting to pull my changes.
I'm not sure whether I've done something wrong here... All folders are in the same location /var/www/
on the same server. And yes, I have ran chmod +x
on the hook.
Yes, I've ran git init --bare
for the live folder and set the origin to the Git repository. I'm a little confused however as to where this hook should live, the live/dev folder?