-
Improvement
-
Resolution: Done
-
Minor
-
None
-
Jenkins ver. 2.65,
Lockable Resources plugin ver. 2.0
If possible, it would be convenient to be able to specify a quantity of zero required resources of a certain type - instead of having to have an "if" condition. This way we could pass in values for quantity and not have to check for 0.
Something like:
lock(resource: 'resource', quantity: 0) { ...
that would essentially be ignored.
Is there a good workaround for this? I don't think a simply "if" will get around it if you still want the code to execute.
Here's my scenario: I am synthesizing HDL in different phases. Some tools require a license for every phase, while some only when creating the final artifact. I want to share the licenses as much as possible and only have the phases lock the license when it's needed. My planned workaround is to have a "license pool" called "infinite" or something like that, and then have like 100 fake items in the pool to be checked out. Then switch out the resource name. But a quantity 0 would be easier and more obvious what I'm aiming for.