Last active
August 29, 2015 14:16
-
-
Save jefferis/bc07c339606c0a65b411 to your computer and use it in GitHub Desktop.
jekyll on flybrain
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 | |
# | |
# An example hook script to prepare a packed repository for use over | |
# dumb transports. | |
# | |
# To enable this hook, rename this file to "post-update". | |
# Jekyll update code | |
# always runs in .git dir | |
GIT_REPO=$PWD | |
REPO=`basename "${GIT_REPO}" | sed s/\.git$// ` | |
TMP_GIT_CLONE=$HOME/tmp/$REPO | |
PUBLIC_WWW=/var/www/$REPO | |
export BUNDLE_PATH=$HOME/bundle | |
# clean up just in case | |
rm -Rf $TMP_GIT_CLONE | |
git clone $GIT_REPO $TMP_GIT_CLONE | |
cd $TMP_GIT_CLONE | |
bundle update | |
# safe is require for jekyll bootstrap to define BASE_PATH liquid variable | |
# if missing assets can't be found etc | |
bundle exec jekyll build --safe -s $TMP_GIT_CLONE -d $PUBLIC_WWW | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://jekyllrb.com/docs/deployment-methods/#git-post-receive-hook for the background. Updating the bundle every time is probably a bit keen but not too slow at the moment.