How to write Pipeline to discard old builds?

前端 未结 9 822
暖寄归人
暖寄归人 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:30

    For declarative pipeline you can add this:

    options {
    
        buildDiscarder(
            logRotator(
                // number of build logs to keep
                numToKeepStr:'5',
                // history to keep in days
                daysToKeepStr: '15',
                // artifacts are kept for days
                artifactDaysToKeepStr: '15',
                // number of builds have their artifacts kept
                artifactNumToKeepStr: '5'
            )
        )
    }
    

提交回复
热议问题