Jenkins delete builds older than latest 20 builds for all jobs

前端 未结 6 567
悲哀的现实
悲哀的现实 2021-01-02 01:30

I am in the process of cleaning up Jenkins (it was setup incorrectly) and I need to delete builds that are older than the latest 20 builds for every job.

Is there an

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 02:17

    There are lots of ways to do this

    Personally I would use the 'discard old builds' in the job config

    If you have lots of jobs you could use the CLI to step through all the jobs to add it

    Alternatively there is the configuration slicing plugin which will also do this for you on a large scale

提交回复
热议问题