Create a new job for cleanup as a freestyle project.Why Groovy ? Jenkins has built-in support for Groovy language(built on JVM and backward compatible with Java ). Install Groovy Post-build plugin to run Groovy script(we write the script in the next steps).Also to create a nightly job to do the automatic cleanup for all jobs in Jenkins. ![]() ![]() Persist only the latest 3 or 5 folders (sorted by date modified) in the workspace or by Sprint numbers(latest 3 or 5 folders based on sprint number) and remove the rest after every successful build. But what if you wanted to look back at the workspace after you build the job? You have nothing left in the workspace, right?Īlright, so none of these plugins solves my problem. One can check this location from the configuration screen of Jenkins. Well, it’s a straightforward thing to do. Jenkins needs some disk space to perform builds and keep archives. how to get permission in create folder and file on hard drive in ubuntu. You might have found that there is a plugin to delete your workspace after executing a build. sudo mkdir /var/lib/jenkinsrestore sudo chown jenkins /var/lib/jenkinsrestore. Then you realize the plugin isn’t working as expected - because it only deletes the build history and not the workspace folders? Okay, how about you use Discard old builds plugin? You might have thought it would do wonders when you looked at the documentation. ![]() Especially, when your jobs are building from Maven/Gradle. If you are here, your Jenkins machine might be loaded with hundreds of jobs that are occupying a major of your disk-space with its uncleaned workspace.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |