Can Codedeploy watch for CodeCommit by itself or it needs CodePipeline

1

I want to use codeDeploy to monitor for CodeCommit activities, if for example a new commit on the main branch, I want to inform EC2 that runs the current version of the app of a new change to the main branch, then from there I will pull the new changes, recompile and rerun the applications. I do wish to use CodePipeline for now. Any thoughts?

FSA
질문됨 8달 전265회 조회
2개 답변
7

Hello,

Yes, the best way to go about this will be to use CodePipeline. I would recommend reading this blog post, which discusses how through the use of CloudWatch Events, on how to trigger your CodePipeline to execute whenever there is a reference created or updated in your CodeCommit repository.

It also mentions some best practices when going about this such as having a manual approval action in your CodePipeline, how to avoid the pipeline from triggering when editing certain files (readme.md, .gitignore, etc), and other custom logic that can help verify if the pipeline should be ran or not.

Hope this helps!

Mark

AWS
답변함 8달 전
3

Hi,

What would be the purpose of "informing" CodeDeploy about a change in CodeCommit if new version is not rebuilt? CodeDeploy cannot make use of new source code until it's recompiled to binary artefacts. So, you're right: the right way is to build a CodePipeline. This pipeline can start automatically on commits in CodeCommit. It will produce the new artefacts and those artefacts will be loaded into CodeArtefacts, from where they can be deployed to your EC2 machines.

And you're 100% right; full automation is the only sustainable way to proceed for the long-term to raise efficiency and quality. I always seek myself to reach this full automation. At the expense of some pains sometimes to find the right setup, but I am so much better off afterwards: things work without me and I can move to something else!

This blog post may be interest to get detail about a canonical architecture to achieve what you want: https://aws.amazon.com/blogs/devops/complete-ci-cd-with-aws-codecommit-aws-codebuild-aws-codedeploy-and-aws-codepipeline/

Good luck!

Didier

profile pictureAWS
전문가
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠