Skip to content

Instantly share code, notes, and snippets.

@sergey-epishkin-lzd
Last active July 14, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sergey-epishkin-lzd/59650dd19bb8be4fd7b68a6f5b21736c to your computer and use it in GitHub Desktop.
Save sergey-epishkin-lzd/59650dd19bb8be4fd7b68a6f5b21736c to your computer and use it in GitHub Desktop.
Jenkins jobs cleanup
def job_regex = "tools.repo_sync.*"
(hudson.model.Hudson.instance.items.findAll { job -> job.name =~ /$job_regex/ }).each {
to_delete -> println ("Deleting workspace for "+to_delete);
to_delete.delete()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment