Skip to content

Instantly share code, notes, and snippets.

@fael
Created March 13, 2013 14:21
Show Gist options
  • Save fael/5152600 to your computer and use it in GitHub Desktop.
Save fael/5152600 to your computer and use it in GitHub Desktop.
Auto-deployment.
*/15 * * * * sh /home/rafael/projects/deployment/deploy-projects
#!/bin/bash
FILE=/home/rafael/projects/deployment/deployment.txt
NOW=now
AUX=auxiliar
touch $AUX
echo `date`' - inicio do deploy' >> $NOW
sleep 2
cd /home/rafael/projects/projeto-um
git pull >> $NOW
cd /home/rafael/projects/projeto-dois
git pull >> $NOW
cd /home/rafael/projects/projeto-tres
echo `date`' - fim do deploy' >> $NOW
echo '***----------------------------------------------------------------------------***' >> $NOW
cat $NOW $FILE > $AUX
cat $AUX > $FILE
rm $NOW $AUX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment