String parameter as lockable resources label in jenkins

六眼飞鱼酱① 提交于 2019-12-11 07:36:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!