docker - Newman Docker 找不到 env 文件
问题描述
目前在我的管道的自动化阶段,我看到了以下错误:
newman 运行集合/something.postman_collection.json -k
错误:ENOENT:没有这样的文件或目录,打开 'collections/something.postman_collection.json'
来自管道的代码
代码:
阶段(“自动化”){
node('build') { def collectionName = 'collections/something.postman_collection.json' def postmanEnvName ='collections/somethingapi.postman_environment.json' def globalsname = 'collections/somethingglobals.postman_globals.json' docker.image('postman/newman_alpine33').inside("--entrypoint=''"){ sh "newman run $collectionName -k" } } }
关于可能是什么问题的任何想法,我尝试了一些不同的组合,例如
“纽曼运行 $collectionName”
“纽曼 $collectionName”
“newman /collections:/etc/newman 运行 $collectionName”
docker.image('postman/newman_alpine33').inside("--entrypoint='' -v /collections:/etc/newman")
谢谢!
解决方案
我认为您的构建服务器没有您尝试访问的文件或文件夹。您可能已经知道-v /collections:/etc/newman
将主机文件夹/collections
安装到您的 docker 映像的 location :/etc/newman
。
在您的情况下,我很确定在根目录下有文件夹collections
,请检查您在哪里复制您的收藏文件。您还可以使用 npm 模块运行和测试您的集合newman
。实际上,这就是您在运行 docker 映像时发生的情况。对于 ref 这里是Dockerfile。
推荐阅读
- java - 保存我的 PNG 会破坏 alpha 通道
- node.js - NestJS 返回 HTTP 请求的结果
- java - Java中的空格和换行符是否被视为一个字节?
- scala - 使用 scala 获取数据框中每个类别的列的最大分钟数
- matlab - Matlab动态绘图轴
- ospf - 我应该在核心交换机还是边缘交换机上启用 OSPF?
- asp.net - 在 HTML 表格标签中使用 AngularJS ng-repeat-start 和 ng-repeat-end 的同一实体的嵌套循环
- asp.net - Akka.net 异步方法处理
- mysql - MySQL 语句在更新中使用 group_concat
- python - 我在 Django 应用程序中同一类的两个对象之间存在 OneToOne 关系。是否可以强制执行这种关系的唯一性?