Created
January 26, 2014 12:30
-
-
Save Foxandxss/8632043 to your computer and use it in GitHub Desktop.
My Lineman post-receive 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
#!/bin/sh | |
read oldrev newrev refname | |
LOGFILE=./post-receive.log | |
DEPLOYDIR=/var/www/lineman/project | |
echo -e "Received Push Request a $( date +%F )" >> $LOGFILE | |
echo " - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE | |
echo "Starting Deploy" >> $LOGFILE | |
echo " - Starting code update" | |
GIT_WORK_TREE="$DEPLOYDIR" git checkout -f | |
echo " - Finished code update" | |
echo "Building the app" | |
echo " - Installing dependencies" | |
cd "$DEPLOYDIR"; npm install | |
echo " - Lineman build" | |
lineman build | |
echo " - Moving the files" | |
rsync -avP --delete dist/ ../www | |
echo " - Cleaning the repo" | |
lineman clean | |
echo "Finished build" | |
echo "Finished Deploy" >> $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment