How do I clear my Jenkins/Hudson build history?

后端 未结 14 1644
醉话见心
醉话见心 2020-12-07 08:10

I recently updated the configuration of one of my hudson builds. The build history is out of sync. Is there a way to clear my build history?

Please and thank you

14条回答
  •  抹茶落季
    2020-12-07 08:37

    Using Script Console.

    In case the jobs are grouped it's possible to either give it a full name with forward slashes:

    getItemByFullName("folder_name/job_name") 
    job.getBuilds().each { it.delete() }
    job.nextBuildNumber = 1
    job.save()
    

    or traverse the hierarchy like this:

    def folder = Jenkins.instance.getItem("folder_name")
    def job = folder.getItem("job_name")
    job.getBuilds().each { it.delete() }
    job.nextBuildNumber = 1
    job.save()
    

提交回复
热议问题