rmcg.ie/post-receive

12 lines
386 B
Plaintext
Raw Normal View History

2022-01-23 00:34:46 +01:00
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/main$ ]];
then
echo "Main ref received. Deploying main branch to production..."
git --work-tree=/srv/http/galshaw.eu --git-dir=/srv/git/galshaw.eu.git checkout -f
else
echo "Ref $ref successfully received. Doing nothing: only the main branch may be deployed on this server."
fi
done