[Jenkins] Cleanup Build History
1. Using Jenkins Script Console
- Manage Jenkins > Script Console
All Jobs
Jenkins.instance.getAllItems().each() { job ->
job.builds.each() { build ->
build.delete()
}
job.updateNextBuildNumber(1)
}
Specific Job
job = Jenkins.instance.getItemByFullName("job_name")
job.builds.each() { build ->
build.delete()
}
job.updateNextBuildNumber(1)
Leave a comment