【发布时间】:2021-09-15 20:43:46
【问题描述】:
如何使用 Spring Boot 集成测试 (java) 在 Azure devops 中运行 Azure cosmos DB Emulator?
目前cosmos DB模拟器只支持windows服务器不支持linux?
有什么建议可以在这里进行吗?
更新:1 对于 windows 构建代理,可以使用来自 azure 管道的以下任务。
- task: CosmosDbEmulator@2
inputs:
containerName: 'azure-cosmosdb-emulator'
enableAPI: 'SQL'
portMapping: '8081:8081, 8901:8901, 8902:8902, 8979:8979, 10250:10250, 10251:10251, 10252:10252, 10253:10253, 10254:10254, 10255:10255, 10256:10256, 10350:10350'
hostDirectory: '$(Build.BinariesDirectory)\azure-cosmosdb-emulator'
对于 Linux: 我使用的和@Ricardo 一样
【问题讨论】:
-
你试过Docker
docker pull microsoft/azure-cosmosdb-emulator吗? -
@4EACH CosmosDB 模拟器仅支持 Windows。 Windows 容器与 Linux 容器不同。
-
好的,据我了解,Azure Devops 没有为 linux 构建代理预定义任务,我们需要为基于 linux 的代理创建自己的任务?
-
@4EACH 我正在尝试使用官方文档中提到的
docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator。 -
@sen 如何你运行它?共享您的管道 YAML。
标签: java spring-boot azure-devops azure-pipelines azure-cosmosdb