
Overview
The Usheru Tracking Application is deployed using a fully automated CI/CD pipeline built on AWS CodePipeline, ECS (Elastic Container Service), and supporting AWS services.
The deployment pipeline handles two environments:
Production →
uts.usheru.comDevelopment →
uts-dev.usheru.com
Source code changes in GitHub are automatically built, tested, containerized, and deployed to the appropriate environment.
Workflow Summary
Source Control (GitHub)
Repository:
usheru-trackingBranches:
main→ triggers production pipeline deploymenttest→ triggers development pipeline deployment
CI/CD Pipeline (AWS CodePipeline)
Orchestrates the build and deployment process.
Stages:
Source Stage
Retrieves source code from GitHub.
Stores artifacts in an S3 bucket (
codepipeline-eu-west-1/SourceArtifact).
Build Stage
Builds and tests a Docker image.
Stores build artifacts in S3 (
codepipeline-eu-west-1/BuildArtifact).Pushes Docker image to ECR (Elastic Container Registry) (
usheru-tracking ECR repo).
Deploy Stage
Creates a new ECS task definition.
Deploys new ECS service version.
ECS (Elastic Container Service)
Runs Docker containers on an EC2-backed ECS cluster.
New tasks are registered and deployed during each pipeline execution.
Networking & Load Balancing
Application Load Balancer (ALB):
Registered with ECS target group (EC2 instances).
Routes traffic to ECS containers via private IPs.
Route 53:
Routes external requests to ALB via CNAME records.
Endpoints:
Production →
uts.usheru.comDevelopment →
uts-dev.usheru.com
Deployment Flow
Developer commits code to
mainortestbranch in GitHub.AWS CodePipeline is triggered.
Pipeline retrieves source and stores it in S3.
CodeBuild:
Builds and tests Docker image.
Pushes new image to ECR.
Stores build artifacts.
ECS deploys a new task definition using the updated image.
ECS service runs containers in EC2 cluster.
Application Load Balancer routes traffic to updated ECS containers.
Route 53 resolves domain names to the ALB.
Key AWS Services Used
GitHub → Source code repository
AWS CodePipeline → CI/CD orchestration
Amazon S3 → Artifact storage (source + build)
AWS CodeBuild → Build and test Docker images
Amazon ECR → Container image repository
Amazon ECS (with EC2 launch type) → Container orchestration
Application Load Balancer (ALB) → Traffic distribution across ECS containers
Amazon Route 53 → DNS routing to application endpoints
Endpoints
Production: https://uts.usheru.com
Development: https://uts-dev.usheru.com
Notes
Separate pipelines for prod and dev ensure isolation between environments.
New ECS task definitions ensure that rollbacks can be performed if needed.
The ALB provides high availability and fault tolerance.
ECS runs containers on an EC2 target group with auto-scaling capabilities (if configured).