Skip to content

Instantly share code, notes, and snippets.

@danielt69
Forked from nodesocket/deploy.sh
Last active August 29, 2015 14:20
Show Gist options
  • Save danielt69/69873bd827bc1ccb4362 to your computer and use it in GitHub Desktop.
Save danielt69/69873bd827bc1ccb4362 to your computer and use it in GitHub Desktop.
BASE_PATH="/srv/www"
REPO_PATH="/srv/www/repo"
GIT_URL="https://github.com/username/repo.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH
git pull --quiet
echo "git pull successfully ran ($(git rev-parse --short HEAD))";
else
cd $BASE_PATH
git clone $GIT_URL --quiet
echo "git clone successfully ran"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment