This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Master ref received, deploying master branch to production" | |
git --work-tree=<Target dir from which static content will be served> --git-dir=<source bare repo dir> checkout -f && \ | |
echo "Success, master branch deployed!!" || \ | |
echo "Error while deploying master branch" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
if ! [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Error: Only \"master\" branch is accepted by this repository" | |
exit 1 | |
fi | |
done |