Last active
July 6, 2016 18:23
-
-
Save curiouslychase/8499671 to your computer and use it in GitHub Desktop.
The post-receive hook that I use for deploying my Wordpress theme on a `git push`.
This file contains hidden or 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 | |
LOGFILE=./post-receive.log | |
DEPLOYDIR=$DEPLOYDIR # The place to deploy to. | |
echo -e "[log] Received push request at $( date +%F)" >> $LOGFILE | |
echo "[log] - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE | |
echo "[log] Starting Deploy..." >> $LOGFILE | |
echo "[log] - Starting code update" | |
GIT_WORK_TREE="$DEPLOYDIR" git checkout -f | |
echo "[log] - Finished code update" | |
echo "[log] - Starting npm install..." | |
cd "$DEPLOYDIR"; npm install; cd - | |
echo "[log] - Finished npm install." | |
echo "[log] - Starting gulp build..." | |
cd "$DEPLOYDIR"; gulp build; cd - | |
echo "[log] - Finished gulp build." | |
echo "[log] - Building Hugo blog..." | |
cd "$DEPLOYDIR" && hugo | |
echo "[log] - Finished building hugo blog" | |
echo "[log] Finished Deploy" >> $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What does the
hugo
command do in your case? I really like this approach to a simple post-receive build system but I'm a bit confused whathugo
is doing.