Skip to content

Instantly share code, notes, and snippets.

@welly
Created June 18, 2014 16:16
Show Gist options
  • Save welly/83b3325022b9eb1a249d to your computer and use it in GitHub Desktop.
Save welly/83b3325022b9eb1a249d 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