【发布时间】:2018-01-13 23:35:48
【问题描述】:
我正在尝试使用 groovy 从 Jenkinsfile 访问文件系统。我正在遵循这个 SO 线程中的建议: Recursive listing of all files matching a certain filetype in Groovy
我已经给了访问权限
new java.io.File java.lang.String
staticField groovy.io.FileType FILES
在脚本批准下。
然而,这条线在没有错误消息的情况下失败:
new File('.').eachFileRecurse(FILES) {
下面是更广泛的代码块:
stage("Install") {
print "here a"
new File('.').eachFileRecurse(FILES) {
print "here c"
if(it.name.endsWith(".sh")) {
print "here d"
println it
}
}
print "here b"
这是该部分的控制台输出:
[Pipeline] stage
[Pipeline] { (Install)
[Pipeline] echo
here a
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
Email Recipients: opike99@gmail.com, opike@yahoo.com
[Pipeline] emailext
messageContentType = text/html; charset=UTF-8
Adding recipients from project recipient list
Adding recipients from trigger recipient list
Setting In-Reply-To since last build was not successful
【问题讨论】:
标签: jenkins groovy jenkins-pipeline