jenkins - 如何在 jenkins 测试工具中使用 getCurrentWorkspace()?
问题描述
在我的 dsl 脚本中,我遍历并读取了一堆文件——这些文件与种子作业在同一个存储库中。
我这样做是为了访问它们(在 jenkins 上工作):
GroovyShell shell = new GroovyShell()
myfiles = hudson.model.Executor.currentExecutor().getCurrentWorkspace().list('/myfolder/**')
如何在测试工具上运行此脚本?
当我通过测试工具运行它时,我得到一个错误。
Cannot invoke method getCurrentWorkspace() on null object
readFileFromWorkspace()
from workspace 似乎有效,但我没有看到类似listFilesFromWorkspace
. 如何以适用于詹金斯和测试工具的方式获取文件列表?
解决方案
推荐阅读
- python - 为什么即使在使用 return 时我的代码最后也没有
- android-studio - 如何在android studio中查看widget的联动进行flutter编程
- sql-server - 用于复制一个数字并将其插入到每 5 行的 SQL 脚本
- pandas - 按 Inspector_ID 分组总和,以及熊猫中的 Day
- flutter - 如何在 Flutter 中将按钮附加到底部?
- node.js - node.js 寻找文件位置
- c++ - 双端队列排序(带计数的线性选择方法 c++)
- css - 跨行和列的网格布局
- python - 找不到满足要求的版本torch==1.3.1
- javascript - Axios在使用异步等待时不返回数据