jenkins 批量删除build记录

Script Console 中输入如下的脚本

def jobName = "picEachBackUP"
def maxNumber = 100
Jenkins.instance.getItemByFullName(jobName).builds.findAll {
  it.number <= maxNumber
}.each {
  it.delete()
}

posted @ 2021-03-07 21:09  该显示昵称已被使用了  阅读(274)  评论(0编辑  收藏  举报