Skip to content

Instantly share code, notes, and snippets.

@dvdvck
Created June 11, 2015 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dvdvck/c29c37cd2d2d9e6e8199 to your computer and use it in GitHub Desktop.
Save dvdvck/c29c37cd2d2d9e6e8199 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