Hello everyone!
In the last installments of the CI/CD pipeline series, we learned code commit, code build, and code deploy.
Today we will automate this whole process by creating an AWS CI/CD pipeline and completing our topic AWS in the DevOps journey.
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.
AWS CodePipeline is a continuous integration and continuous delivery (CI/CD) service provided by Amazon Web Services (AWS). It helps you automate and streamline the process of building, testing, and deploying your applications and software updates. CodePipeline facilitates the efficient and reliable release of code changes by orchestrating the different stages of your software delivery workflow.
Here’s how CodePipeline works:
Source Stage: The pipeline begins with the source stage, where you define a source code repository (such as AWS CodeCommit, GitHub, or Amazon S3) that contains your application code. Whenever changes are pushed to this repository, CodePipeline detects them and triggers the pipeline to start.
Build Stage: In the build stage, you can integrate with build tools like AWS CodeBuild to compile, test, and package your code. This stage is where you generate executable artifacts from your source code.
Test Stage: The next stage involves running automated tests on the generated artifacts to ensure the quality and functionality of your application. You can use various testing frameworks and tools here.
Deploy Stages: Once your code has passed the tests, CodePipeline facilitates deployment to different environments (such as development, testing, and production). You can use a range of AWS services, like AWS Elastic Beanstalk, Amazon ECS, AWS Lambda, and more, to deploy your application.
Approval Stage: Optionally, you can add an approval stage before deploying to production. This allows for manual review and approval before releasing changes to the production environment.
Deploy to Production: After approval (if required), the pipeline deploys the approved changes to the production environment.
Task 1 ) Create a Deployment group of Ec2 Instance.
In the AWS Management Console > Navigate to CodePipeline > Click on pipelines > Create Pipeline > Click on Create pipeline
Step 1: Choose pipeline settings
Pipeline name: day53-app > Select New Service Role > Click on Next
Step 2: Add source stage
Source Provider: AWS CodeCommit > Repository name & Branch Name: Select your repository & branch > Change detection options: AWS CodePipeline > Click on Next
Step 3: Add build stage
Build provider: AWS CodeBuild > Project Name: Select your Build Project > Click on Next
Step 4: Add the deploy stage
Deploy provider: AWS CodeDeploy > Application name & Deployment group: Select your respective choices > Click on Next
Click on Create Pipeline.
Our pipeline is successfully run. To verify this reach our NginX server via our EC2 instance’s Public IPv4.
Thanks for reading ;)