Created
June 18, 2014 16:16
-
-
Save welly/83b3325022b9eb1a249d to your computer and use it in GitHub Desktop.
Jenkins deploy script
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 | |
if [[$BRANCH == '']]; then | |
GIT_BRANCH = "master" | |
else | |
GIT_BRANCH = $BRANCH | |
if | |
if [ -d "/tmp/clone/"]; then | |
rm -rf "/tmp/clone" | |
if | |
mkdir "/tmp/clone/" | |
git clone -b "$GIT_BRANCH" $GIT_URL /tmp/clone/ | |
cd "/tmp/clone/" | |
rsync -rl --exclude=private --exclude=".git" --exclude=".gitignore" /tmp/clone/ /var/www/sites/welly.io/htdocs/ | |
echo "Removing clone directory..." | |
rm -rf /tmp/clone/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment