Details
-
Improvement
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
The current implementation of Pipeline lock step allows to block a single resource.
It should be extended to cover all the functionality of the plugin (applicable to non-freestyle jobs) such as blocking resources by label or request a lock for N resources.
The DSL must be something like this:
lock (resources: ['resource1', 'resource2']) { ... execution block ... }
or
lock (label: 'my-resources') {
... execution block ...
}
The behavior of the label parameter would be equivalent to:
lock (resources: ['resource3', 'resource4']) { // if both resource3 and resource4 are labeled as 'my-resources' ... execution block ... }
Attachments
Issue Links
- is duplicated by
-
JENKINS-38165 Support lockable resource labels in the pipeline
-
- Closed
-
- is related to
-
JENKINS-30269 Add workflow support for resource locking
-
- Resolved
-
-
JENKINS-34273 Extend quantity configuration to Pipeline lock step
-
- Resolved
-
- links to
glance
Did you happen to find any way of getting the resource that's locked in the current lock closure? Your workaround always returns the name of first locked resource. I'm trying to run label-based locks in parallel, so I cannot simply use getResourcesFromBuild(...)[0], but must find out the exact resource locked within current scope. Any ideas?