Last active
August 29, 2015 14:10
-
-
Save zot24/e64431892e10439d647b to your computer and use it in GitHub Desktop.
Jenkins CI Server – Resetting a build number and cleaning a build - http://goo.gl/WLlXYV
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
# | |
# Jenkins build cleaner | |
# Cleans out all builds for projects that exist in the directory | |
# Resets the build number to 1 | |
# Backup all projects before running this | |
function cleanbuild { | |
echo "cleaning $1" | |
cd $1 | |
ls -l | |
rm -Rf builds/* | |
rm -Rf lastSuccesful/ | |
rm -Rf lastStable/ | |
rm -Rf workspace/* | |
rm -Rf modules/* | |
rm -f lastSuccessful lastStable | |
rm -f nextBuildNumber | |
touch nextBuildNumber | |
echo 1 >> nextBuildNumber | |
cd - | |
} | |
for project in `find -L -maxdepth 1 -type d -name '*' ! -name '.*' -printf '%f\n' | column` | |
do | |
cleanbuild $project | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment