Your CI/CD pipeline on AWS - Part 4 ๐Ÿš€ โ˜

Your CI/CD pipeline on AWS - Part 4 ๐Ÿš€ โ˜

ยท

2 min read

What is CodePipeline?

  • CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. Think of it as a CI/CD Pipeline service

Task-01 :

  • Create a Deployment group of Ec2 Instance.

  • Create a CodePipeline that gets the code from CodeCommit, Builds the code using CodeBuild and deploys it to a Deployment Group.

Continuing from where we left off. Anyone reading for the first time please refer to the below article for context.

Navigate to the AWS Management Console and access AWS CodeDeploy.

Within the CodeDeploy dashboard, locate and select "Deployment Groups" from the left sidebar.

Initiate the creation of a deployment group by clicking on the prominent "Create deployment group" button.

Input the essential details:

  • Deployment group name: Assign a distinct name for your deployment group.

  • Deployment type: Choose between "In-place" or "Blue/green" deployment based on your specific needs.

  • Service role: Opt for an existing service role or create a new one that grants the necessary permissions for deployments.

  • Environment configuration: Clearly specify the Amazon EC2 instances or Auto Scaling groups that belong to this deployment group.

  • Deployment settings: Adjust options such as deployment configuration, load balancer, and alarm preferences.

Conclude the setup by clicking on "Create deployment group."

Make sure the EC2 instance is up and running and also has the CodeDeploy agent active.

We have to make a small edit on our buildspec.yml file the artifact shouldn't only be an html file so make the edit as shown in the below image and commit it to our repo.

After this let's go to CodePipeline and Create our very own Pipeline.

Give your desired naming and allow it to create its own service role.

Now select the source stage i.e CodeCommit

Provide the build details

Review all the information that we have provided and then finally click on Create.

The pipeline has been successfully created.

Now the pipeline will be built successfully. But we need to make sure that just our small commit on our repo triggers our deployment. Let's go ahead and make small changes in the HTML file

A new build will be triggered and can be seen below.

You can go to the public IP of our running instance and check it.

Click on refresh once and see the result.


Hope it added some value to your understanding of the concept. See you in the next one. Happy Learning.

ย