Skip to content

Instantly share code, notes, and snippets.

@boscho87
Created March 19, 2019 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boscho87/750ed3afc3eb59c4c7733b0e7f7dd41f to your computer and use it in GitHub Desktop.
Save boscho87/750ed3afc3eb59c4c7733b0e7f7dd41f to your computer and use it in GitHub Desktop.
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to production..."
git --work-tree=/home/simonmul/www/uhc-scorpions.ch --git-dir=/home/simonmul/git/uhc-scorpions.ch checkout -f
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment