Challenge
Manual deployment processes are time-consuming, error-prone, and difficult to scale. The objective was to design a streamlined workflow to automatically build and deploy application updates.
Solution
Implemented a continuous integration and continuous deployment (CI/CD) pipeline that automates the process of building and deploying a web application to AWS. Each code change pushed to the repository triggers an automated workflow, ensuring consistent and efficient delivery of updates.
Key Components:
- Infrastructure as Code (AWS CloudFormation): Automated provisioning of VPC, Security Groups, and EC2 instances to ensure consistent and repeatable environment setup.
- Orchestration (AWS CodePipeline): Managed the end-to-end CI/CD workflow, coordinating source, build, and deployment stages across services.
- Continuous Integration (AWS CodeBuild): Compiled and packaged the application using a buildspec.yml, producing a deployable .war artifact.
- Continuous Deployment (AWS CodeDeploy): Executed in-place deployments on EC2 instances using an appspec.yml and custom Bash scripts.
- Web Architecture (Apache & Tomcat): Configured Apache as a reverse proxy to handle incoming HTTP requests and forward them to the Tomcat application server.
Architecture overview
Step 01
Code is pushed to GitHub, triggering the pipeline.
Step 02
CodePipeline retrieves the source and stores a versioned artifact in S3.
Step 03
CodeBuild compiles the Java application and prepares deployment artifacts.
Step 04
CodeDeploy agent executes scripts to stop the current application and prepare the environment.
Step 05
New application version is deployed to EC2 using in-place deployment strategy.
Step 06
Application is started and validated; rollback is triggered automatically if deployment fails.
Tools
CodePipline
CodeBuild
CodeDeploy
CloudFormation
Git
GitHub
