-
-
Save noblige/adbbeb375f92cfd98f0662cff9271fde to your computer and use it in GitHub Desktop.
Delete failed builds for a job in Jenkins
This file contains hidden or 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 job = Jenkins.instance.getItem("the_job_name") | |
job.getBuilds().each { | |
if(it.result == Result.FAILURE){ | |
// Delete failed job | |
it.delete() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment