BillBie

导航

【转载】[Jenkins] 批量删除构建历史

转载自:https://www.cnblogs.com/shaobin0604/p/9680621.html

在jenkins的

def jobName = "zjt_UIAutoTest"
def maxNumber = 80

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

 

其中maxNumber = 80为被删除的最大构建数

posted on 2019-01-09 15:00  BillBie  阅读(19)  评论(0)    收藏  举报