Jenkins pipeline groovy不能使用eachFileRecurse方法,所以只能使用shell帮忙了。/path和*.txt为可替换参数。
files=sh(returnStdout: true, script: 'find /path -name "*.txt"')
本文介绍了一种在Jenkins Pipeline中使用Groovy脚本通过shell命令来查找指定目录下所有.txt文件的方法。
Jenkins pipeline groovy不能使用eachFileRecurse方法,所以只能使用shell帮忙了。/path和*.txt为可替换参数。
files=sh(returnStdout: true, script: 'find /path -name "*.txt"')
1万+
2459
1872