我正在使用 Jenkins,想要匹配名称以 _TEST
结尾的所有可构建作业,但无法通过正则表达式进行匹配。
我尝试了多种方法,但无法通过 groovy 使其匹配。
最佳答案
与 this one 等效但更简洁的解决方案是
import hudson.model.*
def list = Hudson.instance
.items
.findAll { it.buildable && it.name.endsWith("_TEST") }
.collect { it.name }
关于java - 使用 groovy 匹配字符串结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38441588/