multiple jobDSL() pipeline steps destroys all but the last

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major
    • Component/s: job-dsl-plugin
    • None
    • Environment:

      If you use the pipeline step jobDsl() twice or if you use the "Process job DSL" build step in the GUI only your last step works.

      This destroys anything in the earlier steps.

      Example. Given two jobDSL sections with the following jobDSL:

      folder('zz-folder1')
      job('zz-folder1/job-one')
      
      folder('zz-folder2')
      job('zz-folder2/job-two')
      

      You then get this as the output:

      Processing provided DSL script
      Added items:
          GeneratedJob{name='zz-folder1'}
          GeneratedJob{name='zz-folder1/job-one'}
      Unreferenced items:
          GeneratedJob{name='zz-tron'}
          GeneratedJob{name='zz-tron2'}
      
      Processing provided DSL script
      Added items:
          GeneratedJob{name='zz-folder2'}
          GeneratedJob{name='zz-folder2/job-two'}
      Unreferenced items:
          GeneratedJob{name='zz-folder1'}
          GeneratedJob{name='zz-folder1/job-one'}
      Removed items:
          GeneratedJob{name='zz-folder1'}
      
      Finished: SUCCESS
      

      If you want to set different actions (e.g. DELETE vs. DISABLE) or "ignore changes" then you're going to have a bad day as all but your last jobs get deleted.

            Assignee:
            Daniel Spilker
            Reporter:
            Christian Höltje
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: