Jenkins access lock resources variable in Groovy script to restrict where this project can be run

9 views
Skip to first unread message

chinna obireddy

unread,
Jul 2, 2019, 2:35:34 PM7/2/19
to Jenkins Users

Problem: I have multiple lockable resources at various locations with labels DEVICE_A and DEVICE_B along with Jenkins Slaves labels JS_COUTRYA and JS_COUNTRYB in the respective countries.

Goal: Jenkins should choose the Jenkins SLave based on the Locked Resource for example: If Jenkins Master chooses the Lockable resource in the pool DEVICE_A label, the test must run on the Jenkins Slave node from JS_COUNTRYA. Simple as that.

To achieve this I am using Lockable resource plugin and Groovy Label assignment.

I am trying to access the Variable name created with Lock resource plugin inside the Groovy script to restrict where this project can be run without success. Any suggestions are appreciated. 

Groovy_script.PNG
Lock_resource_label.PNG
Reply all
Reply to author
Forward
0 new messages