Background: Developing a Facebook app using PHP Laravel framework & MySQL for database.
I have setup Gitlab on our development server and create
You would need to add to the bare repo (managed by GitLab) a post-receive
hook which would:
That would be:
cd ~git/repositories/yourRepo.git/hooks
touch post-receive
chmod +x post-receive
You can make sure that hook will only be active if someone pushes on branch master
:
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
# Do something
fi
done
For the checkout done by that hook, see "GIT post-receive checkout without root folder", that is:
make sure you specify --git-dir
and --git-work-tree
:
git --git-dir=/path/to/project_root.git --work-tree=/path/to/your/workingtree checkout -f
Again, /path/to/your/workingtree
can be: