Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64975

BuildRotator doesn't work on declarative pipelines (options section)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • buildrotator-plugin
    • None
    • Jenkins 2.281
      BuildRotator 1.2

      I am trying to use BuildRotator on declarative pipeline but don't have success.

      First try

      options

      { buildDiscarder([$class: 'BuildRotator', artifactsDaysToKeep: -1, artifactsNumToKeep: -1, daysToKeep: -1, numToKeep: 10])) }

      This is generated by jenkins snippet generator, but doesn't work because buidDiscarder does not support $class anymore.

       

      Second try is 

      options

      { buildDiscarder(BuildRotator(artifactsDaysToKeep: -1, artifactsNumToKeep: -1, daysToKeep: -1, numToKeep: 10)) }

      This is like the sintax generated for logRotation plugin but doesn't work too because jenkins can't find BuildRotator

       

      Is there any way to use it in declarative pipeline? If not, can this be implemented?

            jimilian Alexander A
            acrespo Andre Crespo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: