Skip to content

Instantly share code, notes, and snippets.

@alexmerser
Forked from welly/gist:83b3325022b9eb1a249d
Last active September 8, 2015 22:36
Show Gist options
  • Save alexmerser/3244014140215f58c090 to your computer and use it in GitHub Desktop.
Save alexmerser/3244014140215f58c090 to your computer and use it in GitHub Desktop.
Jenkins deploy script
#!/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