如何在jenkins管道文件中获取文件? [英] How to get files in jenkins pipeline file?
本文介绍了如何在jenkins管道文件中获取文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过jenkins管道脚本从工作区中获取具有某种模式的所有文件名.
I want to get all files name with some pattern from work-space through jenkins pipeline script.
从我的工作空间获取pjs文件列表并将其存储到数组中
Get list of pjs files from my work-space and store to array
推荐答案
在当前工作目录中查找文件.步骤返回一个数组 文件信息对象.
Find files in the current working directory. The step returns an array of file info objects.
这些 文件信息对象 具有name
作为属性,因此您可以轻松地获得文件名,如下所示:
These file info objects have name
as a property, so you can easily get the name of the files as below:
例如files[0].name
注意:
请确保使用 dir().
这篇关于如何在jenkins管道文件中获取文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文