Created
June 11, 2015 17:42
-
-
Save dvdvck/c29c37cd2d2d9e6e8199 to your computer and use it in GitHub Desktop.
git hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 [email protected] "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