如何在jenkins管道文件中获取文件? [英] How to get files in jenkins pipeline file?

查看:56
本文介绍了如何在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

注意:

请确保使用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆