Skip to content

Instantly share code, notes, and snippets.

Avatar

vimal krishna vimalkrishna

  • Munich Germany
View GitHub Profile
@vimalkrishna
vimalkrishna / gist:cbfc73067be9631ac34d86a00079e380
Created Jul 18, 2018 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
View gist:cbfc73067be9631ac34d86a00079e380
// 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) {
@vimalkrishna
vimalkrishna / cleanupJenkinsWorkspaces.groovy
Created Jul 16, 2018 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
A jenkins script to clean up workspaces on slaves
View cleanupJenkinsWorkspaces.groovy
// 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.*;
@vimalkrishna
vimalkrishna / gist:22ea8e4d92abb82344172c5005ce0a7d
Created Jul 16, 2018 — forked from zerogvt/gist:081685d53465f2266e419310fcca304a
A jenkins script to clean up workspaces on slaves
View gist:22ea8e4d92abb82344172c5005ce0a7d
// 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.*;
import org.jenkinsci.plugins.workflow.job.WorkflowRun
import org.jenkinsci.plugins.workflow.flow.FlowExecution;