Usage of GroovyPlug's Read/WriteLock to prevent parallel Builds?

Good morning,

I was looking for a way to prevent build B to be built while build A is running and saw on the forum that the GroovyPlug was suggested for a similiar usecase.. but.. how do I use it?

I have 5 configurations, and only one of them may run at any given point of time. Now what exactly do I have to specify under each configuration's 'Properties and Environment Variables' tab? I am somewhat lost :-/

Cheers and thanks,
-J

4 comments

Add system property to all of these configurations:
locks.writeLock.<lockName>

where <lockName> is the name of the shared resource.
Then when each configuration starts it will acquire write lock with given name. If another configuration already locked this resource, configuration will wait for the build of other configuration to finish.

0

Hey there Pavel,

thanks for the quick reply! Do I enter that locks.writeLock.somename in the 'Name' field or in the 'Value' field?

-J

0

It should be name of the property. Value does not matter.


0

Please sign in to leave a comment.