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 System Groovy script to clean up workspaces on all slaves. | |
Check if a slave has < X GB of free space, perform cleanup if it's less. | |
If slave is idle, wipe out everything in the workspace directory as well any extra configured directories. | |
If slave is busy, wipe out individual job workspace directories for jobs that aren't running. | |
Either way, remove custom workspaces also if they aren't in use. | |
**/ | |
import hudson.model.*; |