Pipeline Plugin - pipeline-stage-step

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Do
    • Priority: Major
    • Environment:
      docker run --rm -p 2222:2222 -p 8080:8080 -p 8081:8081 -p 9418:9418 -ti jenkinsci/workflow-demo

      I'm trying to create 'deployment' stages in a JENKINSFILE.

      I set concurrency to 1 for the deployment stage. From reading pipeline-stage step documentation it is said that:

      " Newer builds are always given priority when entering such a throttled stage; older builds will simply exit early if they are preëmpted."

      This is the behavior I'm looking for. However it seems that the original build will always remain running and only subsequent builds are superseded

      steps to reproduce:

      1. run docker demo (cmd listed in ENV section of ticket)
      2. Setup pipeline job with pipeline script:

      stage name: 'round 1', concurrency: 1
      
      input message: '', parameters: [[$class: 'TextParameterDefinition', defaultValue: 'YES', description: '', name: 'READY?']]
      

      3. Run job at least 3 times (but may be useful to run 4 or 5 times to get better idea of bug)

      Expected results:

      job 1 exits when job2 enters 'input' stage
      job 2 exits when job2 enters 'input' stage

      Actual results:

      job 1 never exists
      job 2 exits when job3 enters input stage
      job 3 exits when job 4 enters input stage
      loop keeps going, etc...

      but job 1 never exits

      I suppose work around for now could be to create a "pre deployment" stage that looks for any previous builds and forces them to stop running, but I haven't started working on that yet to understand implications, would prefer this to work as noted, or clearer documentation if I'm using it wrong.

      Please advise

            Assignee:
            Patrik Boström
            Reporter:
            Matt Evans
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: