我正在尝试使用Findfiles列出子目录的内容,但是我遇到了一些问题,
如何获取子目录的内容
尝试过
def files = findFiles(glob: "dirname/**")
,但这永远不会
尝试
dir("dirname") {
def files = findFiles()
}
失败,因为它需要在父级目录上进行写入权限,因为它试图创建dirname@tmp。如果我在父目录上放松权限,它可以工作,但是我真的很想避免在该父目录上写入权限的詹金斯,
我也试图通过在脚本控制台中测试Findfiles如何工作
def files = findFiles()
println(files)
,我会得到
groovy.lang.MissingMethodException: No signature of method: Script1.findFiles() is applicable for argument types: () values: [] Possible solutions: findAll(), findAll(groovy.lang.Closure), find()
已安装,Findfiles在我的构建工作中起作用
I'm trying to use findFiles to list the contents of a sub-directory, but I'm running into some issues
How can I get the contents of a subdirectory
tried
def files = findFiles(glob: "dirname/**")
but that never ends
tried
dir("dirname") {
def files = findFiles()
}
this fails because it needs write permission on the parent directory as it tries to create dirname@tmp . It works if I relax permissions on the parent directory, but I'd really like to avoid jenkins having write permissions on that parent directory
I'm also trying to see how findFiles works by testing it in the Script console
def files = findFiles()
println(files)
there I get
groovy.lang.MissingMethodException: No signature of method: Script1.findFiles() is applicable for argument types: () values: [] Possible solutions: findAll(), findAll(groovy.lang.Closure), find()
https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/ is installed, the findFiles works inside my build job
发布评论
评论(1)
您可以尝试以下操作吗?
Can you try the following.