试图从jenkinsfile访问文件系统
问题描述:
我试图使用groovy从Jenkinsfile访问文件系统。我下面这个SO线程的建议:在脚本审批 Recursive listing of all files matching a certain filetype in Groovy试图从jenkinsfile访问文件系统
我已经获准进入
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: [email protected], [email protected]
[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