CI_CD Pipeline for Scalable and Reliable Deployments
CI_CD Pipeline for Scalable and Reliable Deployments
Reliable Deployments
Introduction
This project aims to improve its software development and deployment process by implementing a
CI/CD pipeline. This pipeline automates key stages such as code build, testing, and deployment, ensuring
faster and more reliable delivery of updates. The solution integrates AWS services, including
CodePipeline, CodeBuild, and Elastic Beanstalk, to streamline operations and reduce manual
intervention. Additionally, a manual approval step before production deployment ensures quality
control. This document details the implementation process and steps taken to set up the CI/CD pipeline
as Proof of Concept (POC).
Table of Contents
1. Project Overview
2. Architecture
3. Key Components
4. Tools and Technologies
5. Implementation Steps
6. Testing Changes
7. Troubleshooting IAM Permissions for Code Pipeline Role Creation.
8. Conclusion
1. Project Overview
Ample Technologies is implementing a CI/CD pipeline to automate the build, test, and deployment
processes, ensuring faster, error-free delivery. The pipeline integrates AWS services and includes a
manual approval step before production rollouts. This document outlines the tools, architecture, and
implementation steps involved in this Proof of Concept (POC).
2. Architecture
EC2
3. Key Components
1. Source Control (GitHub): Repository to store and manage application code and provide version
control for collaborative development.
2. Build Automation (AWS CodeBuild): Builds the application code using a buildspec.yml file for
build instructions.
3. Deployment Platform (AWS Elastic Beanstalk): Hosts the application in a web server
environment configured for Java applications.
4. Pipeline Orchestration (AWS CodePipeline): Automates the CI/CD process integrating source,
build, approval, and deployment stages.
5. Manual Approval from the Manager: Ensures manager’s approval before deploying to
production.
1. AWS CodePipeline: Automates the entire CI/CD workflow, integrating stages like source, build,
approval, and deployment.
2. GitHub: A platform to store and manage the source code, enabling collaboration and version
control.
3. AWS CodeBuild: Compiles source code, runs tests, and generates build artifacts for deployment.
4. AWS Elastic Beanstalk: Simplifies the deployment process by providing a managed environment
for hosting applications.
5. Implementation Steps
1. Code Preparation:
This step involves setting up an AWS CodePipeline to automate the CI/CD workflow. The pipeline
integrates stages for source retrieval, build execution, manual approval, and deployment to the target
environment.
5. Finalize Deployment:
• The pipeline will automatically retrieve the source code, execute the build, and pause after
the build stage for manual approval.
• Once the approval is provided, the pipeline will deploy the application to the specified
Elastic Beanstalk environment.
• Use the following command to verify the current branch in your local repository
git branch
• To fetch a new branch (e.g., add_order) from the remote repository, use
git pull
• Change your working branch to the newly fetched branch (e.g., add_order):
git checkout add_order
git pull
git add .
• In the GitHub repository, initiate a pull request to merge the changes from the add-order
branch to the main branch.
• Review the changes and complete the pull request to merge.
11. Pipeline Triggered and Build Started
• The screenshot demonstrates that the CI/CD pipeline was successfully triggered after merging
the changes into the main branch. It shows the build stage being initiated automatically as part
of the pipeline workflow.
• This screenshot captures the pipeline pausing at the manual approval stage, awaiting the
manager's confirmation before proceeding with the deployment to the production environment.
13. Deployment Successful
• The final screenshot confirms a successful deployment of the updated application after the
manual approval was provided, showcasing the end-to-end execution of the pipeline.
• Two screenshots display the before and after states of the orders in the application.
➢ The before image reflects the state of the orders before the code change was implemented.
➢ The after image highlights the successful addition of new orders, demonstrating the impact of
the changes made to the DAO file and validated through the CI/CD pipeline.
7. Troubleshooting IAM Permissions for Code Pipeline Role Creation
Error Encountered
• To resolve the error by attaching a custom IAM policy to the user, allowing the creation of the
required role for CodePipeline
Steps to Resolve
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Allow",
"Action": "iam:CreateRole",
"Resource": "arn:aws:iam::*:role/AWSCodePipeline*"
}
]
}
• Click Next: Review.
• Provide a name, “CodePipelineCreateRolePolicy”, and click Create Policy.
8. Conclusion
The implementation of the CI/CD pipeline represents a significant advancement in streamlining Ample
Technologies' software development and deployment processes. By leveraging AWS services and
adhering to best practices, the pipeline ensures an efficient, automated, and reliable workflow. It
incorporates critical features like automated builds, continuous testing, and a manual approval step to
maintain high code quality and secure production rollouts.
Extensive testing was performed to validate the pipeline, including code changes, branch management,
and deployment scenarios, ensuring the system’s robustness and reliability. This Proof of Concept not
only highlights the value of CI/CD pipelines in modern software development but also provides a solid
foundation for scaling and optimizing future deployments