我把码头上的东西都收起来了。
我也想在这里存储copilot配置,而不是将新的copilot/目录添加到每个微服务的存储库。据我所知,这应该是可能的。
所以现在我在一个单独的repo中有一个单独的copilot dir,如下所示:
copilot
.workspace
...
- some-service
- mainfest.yml
- other-service
- manifest.yml
等等。这是可行的,我可以添加更多的服务,我可以部署它们。
然而,我尝试创建一个管道,但失败了。根据文档,管道应该能够处理多个服务,但我不明白是怎么做到的。
我能跑
copilot pipeline init
然后,我将生成的文件推送到我的存储库。
然后我试着:
copilot pipeline update
但这会返回一个错误:
ACTION REQUIRED! Go to https://console.aws.amazon.com/codesuite/settings/connections to update the status of connection xy-user-service from PENDING to AVAILABLE.
✘ Failed to create a new pipeline: pipeline-myApp-user-service.
✘ create pipeline: check if changeset is empty: create change set copilot-51ef519a-711b-4126-bfbd-3d618ef824a5 for stack pipeline-myApp-user-service: ValidationError: Template format error: Unrecognized resource types: [AWS::CodeStarConnections::Connection]
status code: 400, request id: 8a87f62a-ae14-4fe3-9a3e-8b965d2af794: describe change set copilot-51ef519a-711b-4126-bfbd-3d618ef824a5 for stack pipeline-myApp-user-service: ValidationError: Stack [pipeline-myApp-user-service] does not exist
status code: 400, request id: 44927d7e-2514-466a-94ff-51e932042737
xy-user-service连接不存在。连接列表为空。我试图创建它,将我的Bitbucket链接到AWS。但是错误仍然存在..
我做错了什么?
我是否应该在每个微服务的根目录中运行copilot app init
(它们位于单独的repos中),然后我是否应该为每个微服务创建单独的管道?
不能只将copilot配置存储在一个地方吗?
提前感谢!
发布于 2021-03-27 01:44:29
听起来你有一个包含所有配置的存储库,每个服务的源代码都有单独的存储库。
如果是这种情况,管道无法工作,因为它需要源代码库的url,而不是包含配置文件的repo;这就是它可以检测触发管道的源代码更改的方式。
您可以在一个Copilot应用程序中拥有多个服务,但如果您希望整个应用程序使用单一管道,则需要将微服务的源代码放在一个存储库中。
请参阅:https://aws.github.io/copilot-cli/docs/concepts/applications/
https://aws.github.io/copilot-cli/docs/concepts/services/
https://aws.github.io/copilot-cli/docs/concepts/pipelines/
(从https://github.com/aws/copilot-cli/issues/2109;交叉发布,我们主要使用GitHub问题进行问答。)
非常感谢!
https://stackoverflow.com/questions/66588240
复制相似问题