Hi Sverre,if I understand your question correctly, the trick would be to:* 
give a unique name to each resource* give all resources (of the same type) the 
same label* request/lock 1 or more resources of the labelyou will then get a 
list containing the locked resource names.gr, M

    On Monday, June 3, 2019, 12:14:58 PM GMT+2, Sverre Moe 
<sverre....@gmail.com> wrote:  
 
 I have created a read-write resource lock
master-sles12.3-readSLES 12.3 repository for master build environment #1Labels 
master-sles12.3-write
master-sles12.3-readSLES 12.3 repository for master build environment #2Labels 
master-sles12.3-write
master-sles12.3-readSLES 12.3 repository for master build environment #3Labels 
master-sles12.3-write
I want the builds to acquire up to three read, on three concurrent builds. 
While with write all read should be locked.I have three build nodes with the 
Label "master-sles12.3" which I am using for  the lock name.
final def repositoryResourceLock = OS + "-read"
lock(repositoryResourceLock) {
  ...
}
However, when one build has acquired the lock of "master-sles12.3-read", the 
other build cannot get a lock.Found 0 available resource(s). Waiting for 
correct amount: 1.[master-sles12.3-read] is locked, waiting...

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/af053486-179f-422b-84d2-2db082c7fc0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/546210278.9826839.1559562640154%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to