How anuragstark/cloudpulse-automated-deployment-cicd works
Project type and purpose
• This is a containerized Flask web application (“DevOps Demo Application”) with a CI/CD pipeline managed by GitHub Actions, an image registry in AWS ECR, and deployment to AWS Elastic Beanstalk (EB). There is no separate database or microservices—just a single-container web app.
File structure
• Top-level:
• Dockerfile & docker-compose.yml → local container build and orchestration
• Dockerrun.aws.json & .ebextensions/ → AWS EB deployment config
• .github/workflows/cicd.yml → GitHub Actions CI/CD pipeline
• app/ → Flask application code (app.py, templates, static assets)
• tests/ → automated tests (test_app.py)
• requirements.txt → Python dependencies
• AWS deployment manifests (Dockerrun.aws.json) and AWS EB extensions indicate a PaaS deployment on EB.
README for additional insights
• CI/CD flow: push to GitHub → GitHub Actions builds Docker image → pushes to ECR → uploads Dockerrun to S3 → updates EB environment
• AWS resources: ECR repo, S3 bucket for artifacts, EB application/environment, IAM user for Actions
Main components and interactions
a. Developer Workstation
• Writes Flask code under app/
• Runs local tests (pytest via tests/) and docker-compose
• Commits/pushes code to GitHub
b. GitHub Repository & GitHub Actions
• Trigger: push to main branch
• Steps: run tests → build Docker image → tag & push to ECR → upload Dockerrun.aws.json to S3 → deploy/update EB
c. AWS ECR (Elastic Container Registry)
• Stores Docker image: devops-demo-app:latest
d. AWS S3 Bucket
• Hosts Dockerrun.aws.json (deployment descriptor)
e. AWS Elastic Beanstalk
• Load Balancer + Auto Scaling Group of EC2 instances running Docker container on port 5000 → mapped to port 80
• Uses IAM roles (aws-elasticbeanstalk-ec2-role)
f. End-User (Web Browser)
• Sends HTTP requests to EB Load Balancer → routes to container
Architectural patterns and design principles
• Containerization (Docker) for consistent environments
• PaaS deployment via Elastic Beanstalk (abstracts infra management)
• CI/CD pipeline (GitOps pattern)
• Separation of concerns: code, build/test, registry, deployment, runtime
Elements
• Clear component names (e.g., “GitHub Actions CI/CD,” “AWS ECR Registry,” “Elastic Beanstalk Environment”)
• Source code & tests
• CI/CD pipeline
• Container registry & artifact storage
• Deployment platform & runtime
• Client traffic