Update post-receive hook to avoid unwanted merge
This commit is contained in:
parent
d1cc5fcb25
commit
0b79ea838c
@ -19,10 +19,16 @@ do
|
|||||||
# only checking out the master (or whatever branch you would like to deploy)
|
# only checking out the master (or whatever branch you would like to deploy)
|
||||||
if [ "$ref" = "refs/heads/master" ];
|
if [ "$ref" = "refs/heads/master" ];
|
||||||
then
|
then
|
||||||
echo "Ref $ref received. Deploying master branch to production..."
|
|
||||||
cd $TARGET
|
cd $TARGET
|
||||||
unset GIT_DIR
|
unset GIT_DIR
|
||||||
|
PROD_BR=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
if [ $PROD_BR != "master" ];
|
||||||
|
then
|
||||||
|
echo "Production repo is on $PROD_BR branch. Aborting..."
|
||||||
|
else
|
||||||
|
echo "Ref $ref (${newrev:0:7}) received. Deploying master branch to production..."
|
||||||
git pull --ff-only $REMOTE master
|
git pull --ff-only $REMOTE master
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Ref $ref received. Doing nothing: only the master branch may be deployed on this server."
|
echo "Ref $ref received. Doing nothing: only the master branch may be deployed on this server."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user