Created
October 15, 2012 20:30
-
-
Save bmcmurray/3895214 to your computer and use it in GitHub Desktop.
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 | |
# Make a static clone the working copy of a Jenkins build | |
# to a public directory for browser testing. | |
# Also cleans clones older than 14 days | |
# | |
# Parameters: | |
# $1: Publish target (absolute path, without "$1") | |
# $2: ID to use for the static clone directory | |
# | |
# Usage: | |
# From within the Jenkins working copy directory. | |
# | |
# version 3 (2012-06-07) | |
dest="/Users/bmcmurray/jq-testswarm/build" | |
echo "Creating a static clone of the current directory." | |
echo "Group: $1" | |
echo "Copy ID: $2" | |
mkdir $dest/$1 | |
mkdir $dest/$1/$2 | |
echo "Copying... to " $dest/$1/$2 | |
rsync -a --exclude=".git*" . $dest/$1/$2 | |
echo "Cleaning up outdated copies" | |
cd $dest/$1 | |
find . -maxdepth 1 -ctime +14 | grep -v master | xargs rm -rf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment