1
我試圖使用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