How yousramsaouri/pipeline-jenkins-docker-ansible-sur-aws works
Project Type and Purpose
• This repository demonstrates a CI/CD pipeline that builds and deploys a simple web application (index.html) using Jenkins, Docker, Ansible, and AWS.
• Key indicators:
• Jenkinsfile – defines pipeline stages
• Dockerfile – containerizes the application
• README title – “Pipeline-Jenkins-Docker-Ansible-sur-AWS”
File Structure Analysis
• Top‐level files only:
• Dockerfile – instructions to build the web server image
• Jenkinsfile – pipeline definition (checkout, build Docker image, push, deploy)
• index.html – simple web app, source artifact
• README.md – high-level description
• No nested folders; everything lives at root, implying a small demo or PoC pipeline.
Architecture Overview from README
1. Source control → Jenkins
2. Build → Docker image
3. Repository → Container registry (e.g., Docker Hub or ECR)
4. Deploy → AWS via Ansible
Main Components
a. Developer & Source Control
• Git (e.g., GitHub/GitLab) containing index.html, Dockerfile, Jenkinsfile
b. CI Server
• Jenkins master (reads Jenkinsfile)
• Agents (optional) that run builds and deployments
c. Container Build & Registry
• Docker daemon (builds image from Dockerfile)
• Docker registry (Docker Hub or AWS ECR)
d. Configuration Management & Deployment
• Ansible controller/playbooks (not shown in file tree but implied)
• SSH connection or API calls to AWS
e. Cloud Infrastructure
• AWS account: EC2 instances (or other compute), possibly behind a load balancer
• VPC, security groups, etc.
Relationships and Data Flows
1. Developer pushes code to Git → triggers Jenkins webhook.
2. Jenkins checks out code → runs pipeline stages:
• Build stage: Docker build → image
• Push stage: Docker push → registry
• Deploy stage: Ansible playbook runs against AWS inventory
3. Ansible provisions/updates EC2 host(s) → pulls new Docker image → runs container serving index.html.
4. End-user traffic flows via AWS load balancer → EC2 → container → index.html.
Architectural Patterns and Principles
• CI/CD pipeline (automated build, test, deploy)
• Infrastructure as Code (Ansible playbooks for provisioning & deployment)
• Immutable infrastructure concept (new Docker image per commit)
• Separation of concerns: CI (Jenkins), packaging (Docker), deployment (Ansible), hosting (AWS).
Technologies and Frameworks
• Jenkins (pipeline as code)
• Docker (containerization)
• Ansible (configuration management)
• AWS (compute platform, optional services like ELB, ECR)
• Git (source version control)