Created
October 26, 2012 03:41
-
-
Save ajford/3956737 to your computer and use it in GitHub Desktop.
Static site deployment via git 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 | |
# Deploy hook for static sites (or similar application). | |
# | |
# Written by Anthony Ford <[email protected]> | |
# | |
# Essentially clones the repo into a directory then removes | |
# the git related files. | |
REPO_DIR=`pwd` | |
DEPLOY_DIR='/tmp/deploy' | |
echo "Deploy Dir: "$DEPLOY_DIR | |
if [ ! -e $DEPLOY_DIR ]; then | |
mkdir $DEPLOY_DIR | |
fi | |
git clone $REPO_DIR $DEPLOY_DIR | |
rm -rf $DEPLOY_DIR/.git | |
echo "Done Deploying" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment