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
#!/usr/bin/env python | |
# expect creds to be configured in ~/.netrc | |
import sys | |
from urllib.parse import urlparse, urlunparse | |
import requests | |
script = r""" | |
def sout = new StringBuilder(), serr = new StringBuilder() |
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
def jobnames = Jenkins.instance.getJobNames() | |
jobnames.each { | |
println("Checking Job: ${it}"); | |
def job = Jenkins.instance.getItemByFullName(it) | |
job.getBuilds().each { | |
if (it.result == Result.FAILURE) { | |
// Delete failed job | |
it.delete() | |
} | |
} |