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

Extend quantity configuration to Pipeline lock step

      Extend the use of quantity configuration parameter to the lock step.

      The behavior should be the same than defined for freestyle builds.

      The DSL should look like this:

      lock (resource: 'RAM', quantity: 3) { ... }
      

      quantity must be applicable to any of resource, resources or label (see JENKINS-34268).

          [JENKINS-34273] Extend quantity configuration to Pipeline lock step

          Antonio Muñiz created issue -
          Antonio Muñiz made changes -
          Link New: This issue is related to JENKINS-34268 [ JENKINS-34268 ]
          Nigel Harniman made changes -
          Link New: This issue is related to JENKINS-30269 [ JENKINS-30269 ]

          Florian Hug added a comment -

          This functionality has been implemented (together with the label functionality of JENKINS-34268) in PR26. Since this is my first Jenkins plugin contribution (and my first actual Java implementation) I'm open for any kind of feedback.

          lock(label: "MyLabelName", quantity: 3) {
              // body
          }
          

          Florian Hug added a comment - This functionality has been implemented (together with the label functionality of JENKINS-34268 ) in PR26 . Since this is my first Jenkins plugin contribution (and my first actual Java implementation) I'm open for any kind of feedback. lock(label: "MyLabelName" , quantity: 3) { // body }
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170336 ] New: JNJira + In-Review [ 183864 ]

          Epsilon B added a comment -

          Confirmed working in PR26
          Merged also in PR36

          Epsilon B added a comment - Confirmed working in PR26 Merged also in PR36

          Code changed in jenkins
          User: Antonio Muniz
          Path:
          src/main/java/org/jenkins/plugins/lockableresources/BackwardCompatibility.java
          src/main/java/org/jenkins/plugins/lockableresources/LockStep.java
          src/main/java/org/jenkins/plugins/lockableresources/LockStepExecution.java
          src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java
          src/main/java/org/jenkins/plugins/lockableresources/LockableResourcesManager.java
          src/main/java/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction.java
          src/main/java/org/jenkins/plugins/lockableresources/queue/LockRunListener.java
          src/main/java/org/jenkins/plugins/lockableresources/queue/LockableResourcesStruct.java
          src/main/java/org/jenkins/plugins/lockableresources/queue/QueuedContextStruct.java
          src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config.jelly
          src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-label.html
          src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-quantity.html
          src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-resource.html
          src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java
          http://jenkins-ci.org/commit/lockable-resources-plugin/974572db98214f7b9293a303c9fd8371877250a0
          Log:
          Merge pull request #42 from amuniz/pr-26-fix

          JENKINS-34268JENKINS-34273 Lock multiple resources with specific quantity

          Compare: https://github.com/jenkinsci/lockable-resources-plugin/compare/ba48550fa5bc...974572db9821

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Antonio Muniz Path: src/main/java/org/jenkins/plugins/lockableresources/BackwardCompatibility.java src/main/java/org/jenkins/plugins/lockableresources/LockStep.java src/main/java/org/jenkins/plugins/lockableresources/LockStepExecution.java src/main/java/org/jenkins/plugins/lockableresources/LockableResource.java src/main/java/org/jenkins/plugins/lockableresources/LockableResourcesManager.java src/main/java/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction.java src/main/java/org/jenkins/plugins/lockableresources/queue/LockRunListener.java src/main/java/org/jenkins/plugins/lockableresources/queue/LockableResourcesStruct.java src/main/java/org/jenkins/plugins/lockableresources/queue/QueuedContextStruct.java src/main/resources/org/jenkins/plugins/lockableresources/LockStep/config.jelly src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-label.html src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-quantity.html src/main/resources/org/jenkins/plugins/lockableresources/LockStep/help-resource.html src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java http://jenkins-ci.org/commit/lockable-resources-plugin/974572db98214f7b9293a303c9fd8371877250a0 Log: Merge pull request #42 from amuniz/pr-26-fix JENKINS-34268 JENKINS-34273 Lock multiple resources with specific quantity Compare: https://github.com/jenkinsci/lockable-resources-plugin/compare/ba48550fa5bc...974572db9821

          Released as 1.11

          Antonio Muñiz added a comment - Released as 1.11
          Antonio Muñiz made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Antonio Muñiz made changes -
          Remote Link New: This issue links to "PR (Web Link)" [ 15143 ]

            amuniz Antonio Muñiz
            amuniz Antonio Muñiz
            Votes:
            7 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: