skip to Main Content

I have some ready-made pipelines built using CodePipeline. Let’s say I wish to link them to a testing environment (whether on EC2 or ECS). How can I achieve that?

I appreciate someone mentioning the steps/procedure from a high-level perspective.

So far I have tried the below:
1. Rerun the current pipelines on different branches prior to merging them to the main/working branch.
2. Create an EC2 instance to temporarily test the backend API

2

Answers


  1. Chosen as BEST ANSWER

    One can leverage Amazon ECS via creating a staging environment and link it to a testing domain hosted inside a zone on Route 53. Additionally, this staging environment can be linked to Amazon CodeSuite (CodeBuild and CodeDeploy w/ Code Pipeline).

    The same applies for EC2.


  2. From a high-level view, you typically have separate steps in CodePipeline for test and deployment on each environment. A common flow would look like this:

    • Code is checked in
    • Pipeline is triggered
    • Code is built and tested (e.g. unit tests)
    • Artifacts are deployed to testing environment
    • Application is tested (e.g. integration tests, smoke tests, etc)
    • Artifacts are deployed to prod environment
    • Application is tested

    Ideally stages are also separated through different AWS accounts, like one account for dev (potentially including the Pipeline itself), one for testing, and one for prod. See the image below and related blog post for illustration and more information.

    enter image description here

    While that works well for the common trunk-based development model, it sounds as if you may want to run the Pipeline on separate branches instead.

    For that, you can implement a mechanism that will create a new Pipeline using a CloudFormation template, whenever a new branch is created. The high-level idea is shown in the diagram below. This blog post provides the full details on how to implement the approach.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search