Created
June 29, 2014 12:36
-
-
Save ulysses4ever/5ab89633ef4b29ef5c5f to your computer and use it in GitHub Desktop.
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/bash | |
cd | |
mkdir site-repo.git | |
cd site-repo.git | |
git --bare init | |
cat << EOF > hooks/post-receive | |
#!/bin/bash | |
GIT_REPO=$HOME/site-repo.git | |
TMP_GIT_CLONE=$HOME/tmp/repo | |
TMP_WWW=$HOME/tmp/site | |
PUBLIC_WWW=$HOME/public_html | |
git clone $GIT_REPO $TMP_GIT_CLONE | |
jekyll build -s $TMP_GIT_CLONE -d $TMP_WWW | |
rm -Rf $TMP_GIT_CLONE | |
cp -r $TMP_WWW/* $PUBLIC_WWW | |
rm -Rf $TMP_WWW | |
EOF | |
chmod 775 post-receive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment