Skip to content

Instantly share code, notes, and snippets.

View jbaginski's full-sized avatar

Janusz Bagiński jbaginski

View GitHub Profile
@jbaginski
jbaginski / gist:57ef274c3adaf359207e2b7a9de966db
Created October 10, 2017 14:23 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {