[英]Using groovy to match end of string
I'm using Jenkins and want to match all buildable jobs whose names end in _TEST
but can't get it to match via regex.我正在使用 Jenkins 并希望匹配名称以
_TEST
但无法通过正则表达式匹配的所有可构建作业。
I have tried several ways but haven't been able to get it to match via groovy.我尝试了几种方法,但无法通过 groovy 使其匹配。
I actually found a different way around my problem.我实际上找到了解决我的问题的不同方法。 Sorry, Monday mornings :)
对不起,星期一早上:)
import hudson.model.*
def list = []
for (item in Hudson.instance.items.findAll()) {
if (item.name.endsWith("_TEST")) {
if (item.isBuildable()) {
list.push(item.name)
}
}
}
return list
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.