Skip to content

Instantly share code, notes, and snippets.

@grigorye
Last active August 29, 2015 14:21
Show Gist options
  • Save grigorye/a8cac78386ae73358abb to your computer and use it in GitHub Desktop.
Save grigorye/a8cac78386ae73358abb to your computer and use it in GitHub Desktop.
import hudson.matrix.MatrixRun
import hudson.matrix.MatrixBuild
for (i in Jenkins.instance.items) {
i.builds.findAll {it.result && (it.result != Result.SUCCESS) && (it.result != Result.UNSTABLE)}.each {
println(it)
println(it.result)
if (it instanceof MatrixBuild) {
MatrixBuild matrixRun = it
for (j in matrixRun.getExactRuns()) {
println(j)
j.delete()
}
}
it.delete()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment