Created
December 16, 2013 02:49
-
-
Save santiblanko/7981645 to your computer and use it in GitHub Desktop.
Post-receive hook with composer.
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
it --work-tree=/var/www/laravel --git-dir=/var/repo/gob.git checkout -f | |
## store the arguments given to the script | |
#read oldrev newrev refname | |
## Where to store the log information about the updates | |
LOGFILE=./post-receive.log | |
# The deployed directory (the running site) | |
DEPLOYDIR=/var/www/laravel | |
## Record the fact that the push has been received | |
echo -e "Received Push Request at $( date +%F )" >> $LOGFILE | |
echo " - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE | |
## Update the deployed copy | |
echo "Starting Deploy" >> $LOGFILE | |
echo " - Starting code update" | |
GIT_WORK_TREE="$DEPLOYDIR" git checkout -f | |
echo " - Finished code update" | |
echo " - Starting composer update" | |
cd "$DEPLOYDIR"; composer update; cd - | |
echo " - Finished composer update" | |
echo "Finished Deploy" >> $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment