How to write Pipeline to discard old builds?

前端 未结 9 827
暖寄归人
暖寄归人 2020-12-04 20:24

The groovy syntax generator is NOT working for sample step properties: Set Job Properties. I\'ve selected Discard old builds and then entered

9条回答
  •  臣服心动
    2020-12-04 21:24

    If you need a programmatic way (i.e. doing this from a function, rather than using options{} pipeline syntax):

    def someFunction() {
      ...
      properties([
        buildDiscarder(logRotator(numToKeepStr: '5'))
      ])
    }
    

提交回复
热议问题