How to deploy every branch I push to my CodeCommit repo

0

I have a pipeline on CodePipeline that checks the master branch on a repo on CodeCommit. Every time there's a change in the master branch, the branch is deployed to my production stack. Pretty standard.

Now, for test purposes, I want to create a new pipeline to be able to push any feature branch to the test stack.

Every time I execute git push origin feature-1, or git push origin feature-2, ecc..., I want that feature branch to be deployed. In this way I can test the branch and then merge it to master to deploy it to prd. Is that possible?

It is OK if the branches to be deployed to test need to have a prefix. Of courde I would like not to trigger the first pipeline.

thanks M

질문됨 일 년 전1396회 조회
2개 답변
1
수락된 답변

The way that CodePipeline works today each branch would need its own pipeline and each branch would trigger is respective pipeline. So if you push to your test branch codepipline on the main branch should not trigger until you merge changes to the main branch. If you pushed to test and it passed all your tests, you can have a step in codepipeline using codebuild or a lambda invoke step that merges the test branch into Main, which would then trigger that pipeline out to production. You can take a look at this blog post which provides another way to accomplish this and included sample code. You can also look at the preview of CodeCatalyst as well. Hope this make sense and is helpful.

profile pictureAWS
aaron_l
답변함 일 년 전
  • You can blame me for this behavior :). I had identified an issue when BitBucket integration was in beta and I wanted to have separate Pipeline in my Development, Staging, and Production environments to match with my branches.

0

Follow this: https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-trigger-source-repo-changes-console.html.

You will need to setup a cloud watch rule associated to code commit, which then can be customized with either lambda or other integrations.

profile picture
전문가
답변함 일 년 전

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

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

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

관련 콘텐츠