Skip to content

Instantly share code, notes, and snippets.

@BillBarnhill
Forked from dvdvck/post-receive
Created November 23, 2015 12:21
Show Gist options
  • Save BillBarnhill/761867acf65ea355294b to your computer and use it in GitHub Desktop.
Save BillBarnhill/761867acf65ea355294b to your computer and use it in GitHub Desktop.
git hook
#!/usr/bin/env bash
#Actualiza el servidor de produccion con el merge realizado
#en la rama release
#La informacion se sincroniza con rsync para no tener un repositorio
#en el servidor. NO. Se necesita hacer una copia local. no tiene sentido
#Hacer un puente con ssh y luego ejecutar git pull en el servidor
while read oldrev newrev ref; do
if [[ $ref =~ .*/release$ ]];
then
echo "Release ref received. Deploying master branch to production..."
ssh bitnami@vidafull.mx "cd apps/tienda/new && git pull"
else
echo "Ref $ref successfully received. Doing nothing: only the release 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