[英]Newman Docker cannot find env file
當前在管道的自動化階段,我看到了以下錯誤:
紐曼運行collections / something.postman_collection.json -k
錯誤:ENOENT:沒有此類文件或目錄,請打開“ collections / something.postman_collection.json”
來自管道的代碼
碼:
stage('Automation'){
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映像上的位置:/etc/newman
。
以您的情況,我很確定根目錄下有一個名為collections
文件夾,請檢查您要將collections文件復制到哪里。 您還可以使用npm模塊newman
運行和測試您的集合。 實際上,這是您通過docker image運行時發生的情況。 供參考的是Dockerfile 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.