问题
I am trying to setup a job with the use of lockable resources. My job is parameterized and one of the String parameters is parameter 'ENVIRONMENT'.
I would like to use this parameter as groovy expression label for lockable resources plugin, i.e.:
groovy:resourceLabels.contains(${ENVIRONMENT})
but the expression is not being evaluated.
Is there a way to make it evaluate String parameter like this?
回答1:
I'm not sure it's the only problem, but it looks like double-quotes are missing
groovy:resourceLabels.contains("${ENVIRONMENT}")
cf groovy gstring
来源:https://stackoverflow.com/questions/46176472/string-parameter-as-lockable-resources-label-in-jenkins