简体   繁体   English

AWS CodeCommit:存储库通知与存储库触发器

[英]AWS CodeCommit: Repository Notifications vs Repository Triggers

Notifications: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html通知: https : //docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html

Triggers: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify.html触发器: https : //docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify.html

The official document states that for CodeCommit repository 'events which follow CloudWatch Event Rules' (like pull requests), we use Repository Notifications.官方文档指出,对于 CodeCommit 存储库“遵循 CloudWatch 事件规则的事件”(如拉取请求),我们使用存储库通知。

Whereas for CodeCommit repository events which are just 'operational events' (like creating branches, pushing code to a branch), we use Repository Triggers.而对于只是“操作事件”的 CodeCommit 存储库事件(例如创建分支、将代码推送到分支),我们使用存储库触发器。

I don't understand the difference between 'events which follow CloudWatch Event Rules' and 'operational events'.我不明白“遵循 CloudWatch 事件规则的事件”和“操作事件”之间的区别。 For me, both pull requests and pushing code to branch seem similar events.对我来说,拉取请求和将代码推送到分支似乎是相似的事件。

Thus, confused between why we need both Repository Notifications and Repository Triggers.因此,在为什么我们需要存储库通知和存储库触发器之间感到困惑。

I have asked the same question today and I found this on docs :我今天问了同样的问题,我在文档上找到了这个:

Repository notifications are different from repository triggers.存储库通知不同于存储库触发器。 Although you can configure a trigger to use Amazon SNS to send emails about some repository events, those events are limited to operational events, such as creating branches and pushing code to a branch.尽管您可以配置触发器以使用 Amazon SNS 发送有关某些存储库事件的电子邮件,但这些事件仅限于操作事件,例如创建分支和将代码推送到分支。 Triggers do not use CloudWatch Events rules to evaluate repository events.触发器不使用 CloudWatch Events 规则来评估存储库事件。 They are more limited in scope.它们的范围更有限。 For more information about using triggers, see Manage Triggers for a Repository.有关使用触发器的更多信息,请参阅管理存储库的触发器。

IMO, AWS documentation has not clearly stated the difference between notification and triggers and cloudwatch events. IMO、AWS 文档没有明确说明通知和触发器与云监视事件之间的区别。 Here is my understanding :这是我的理解:

Notifications should be used for literal notification and not for taking action based on them.通知应用于文字通知,而不是用于根据通知采取行动。

Triggers are supposed to initiate action.触发器应该启动动作。 So, if I need to invoke some service based on this event on which trigger is based, I would do that and hence the option to integrate Lambda service.因此,如果我需要基于触发器所基于的此事件调用某些服务,我会这样做,因此可以选择集成 Lambda 服务。 In a way to add automation after codecommit events.以一种在代码提交事件后添加自动化的方式。

However, Cloudwatch Events provide a wide variety of integration option for codecommit events which are not available with trigger.但是, Cloudwatch Events为触发器不可用的代码提交事件提供了多种集成选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM