-
Improvement
-
Resolution: Fixed
-
Major
-
None
I am working on implementing a build job using Jenkins Multibranch Pipelines. The final stage is uploading the build output to Artifactory.
When configuring a standalone job via the interface, there is an option to "Discard old builds from Artifactory" which allows me to only keep the same number of builds as specified in "Max # of builds to keep" setting.
A "normal" DSL job can be configured like this https://issues.jenkins-ci.org/browse/JENKINS-29856, but I haven't been able to figure out how to set discardOldBuilds to true in my multibranch pipeline Jenkinsfile.
The upload stage in my Jenkinsfile is configured like this: https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin
... and I also have the following in my Jenkinsfile which does clean-up the builds in the Jenkins workspace:
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', numToKeepStr: '10']]])
Assuming (maybe wrongfully) that this is a limitation of the current pipeline artifactory DSL and it's currently not possible to set discardOldBuilds to true, would it be possible to have this feature added to the roadmap? If not, I would be very open to any and all enlightening initiatives.
- duplicates
-
JENKINS-68822 Don't keep Build Discarder/Logrotator's last stable/successful builds forever
- Closed
- is blocked by
-
JENKINS-73864 Invalid parameter "removeLastBuild", did you mean "numToKeepStr"?
- Resolved