aws codecommit的cdk结构
aws-cdk.aws-codecommit的Python项目详细描述
aws codecommit构造库
aws codecommit是一个版本控制服务,它允许您在aws云中私人存储和管理git存储库。
有关codecommit的更多信息, 请参阅AWS CodeCommit documentation。
将codecommit存储库添加到堆栈:
importcodecommit=require('@aws-cdk/aws-codecommit');constrepo=newcodecommit.Repository(this,'Repository',{repositoryName:'MyRepositoryName',description:'Some description.',// optional property});
要将amazon sns触发器添加到存储库:
// trigger is established for all repository actions on all branches by default.repo.notify('arn:aws:sns:*:123456789012:my_topic');
事件
codecommit存储库为某些活动发出amazon cloudwatch事件。
使用repo.onXxx
方法定义触发这些事件的规则
并因此调用目标:
// starts a CodeBuild project when a commit is pushed to the "master" branch of the reporepo.onCommit('CommitToMaster',{target: newtargets.CodeBuildProject(project),branches:['master'],});// publishes a message to an Amazon SNS topic when a comment is made on a pull requestconstrule=repo.onCommentOnPullRequest('CommentOnPullRequest',{target: newtargets.SnsTopic(myTopic),});