纽曼Docker无法找到env文件

问题描述 投票:0回答:1

目前在我的管道的自动化阶段,我看到以下错误:

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" 
} } }

关于什么可能是问题的任何想法,我尝试了一些不同的组合,例如

“newman run $ collectionName”

“newman $ collectionName”

“newman / collections:/ etc / newman run $ collectionName”

docker.image('postman / newman_alpine33')。inside(“ - entrypoint ='' - v / collections:/ etc / newman”)

谢谢!

docker postman newman
1个回答
0
投票

我认为您的构建服务器没有您尝试访问的文件或文件夹。您可能已经知道-v /collections:/etc/newman将主机文件夹/collections安装到位于:/etc/newman的docker镜像上。

在您的情况下,我很确定根据名称collections存在根文件夹,检查您复制集合文件的位置。您还可以使用npm模块newman运行和测试您的集合。实际上,当您运行docker镜像时会发生这种情况。对于ref,这里是Dockerfile

© www.soinside.com 2019 - 2024. All rights reserved.