Jenkins 手动删除构建历史脚本

//项目名称
def projectName = "jk-hr-talent"
//删除小于64的构建历史
def maxNumber = 9
 
Jenkins.instance.getItemByFullName(projectName).builds.findAll {
  it.number <= maxNumber
}.each {
  it.delete()
}
posted @ 2022-11-01 16:23  菜阿  阅读(33)  评论(0编辑  收藏  举报