def jobName = "yi-cloud-operation" //删除的项目名称
def maxNumber = 300 // 保留的最小编号,意味着小于该编号的构建都将被删除
Jenkins.instance.getItemByFullName(jobName).builds.findAll {
it.number <= maxNumber
}.each {
it.delete()
}
def jobName = "yi-cloud-operation" //删除的项目名称
def maxNumber = 300 // 保留的最小编号,意味着小于该编号的构建都将被删除
Jenkins.instance.getItemByFullName(jobName).builds.findAll {
it.number <= maxNumber
}.each {
it.delete()
}