View gist:36cf507866438adb8c44
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does --skipping folders, preserving offline status | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
def sizeLimit = 10 // GB |