# tamil27092005/cicd architecture

> Architecture diagram of the GitHub repository tamil27092005/cicd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tamil27092005/cicd
- Repository: https://github.com/tamil27092005/cicd

## Overview

This repository demonstrates a CI/CD product: a push triggers Jenkins to validate the Python app, build and publish a container, provision AWS infrastructure when requested, deploy to EC2, and check the deployed health endpoint. Terraform owns infrastructure provisioning; Ansible configures the host and deploys the image. The Flask app provides welcome, health, and runtime-info endpoints. Pipeline and infrastructure links below follow README documentation; Jenkinsfile and deployment source were not sampled, so implementation details beyond those documented are not inferred.

Main entry points: [`Jenkinsfile`](https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile) (Jenkins), [`ansible/playbook.yml`](https://github.com/tamil27092005/cicd/blob/main/ansible/playbook.yml) (Host Deployment), [`Dockerfile`](https://github.com/tamil27092005/cicd/blob/main/Dockerfile) (Image Build), [`terraform`](https://github.com/tamil27092005/cicd/tree/main/terraform) (Infrastructure Provisioning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["CI/CD Pipeline"]
  node_jenkins["Jenkins"]
  node_checkout["Source Checkout"]
  node_lint["Lint"]
  node_unit_tests["Unit Tests"]
  node_smoke_test["Health Smoke Test"]
end

subgraph group_container["Container Release"]
  node_docker_build["Image Build"]
end

subgraph group_infrastructure["Infrastructure"]
  node_terraform["Infrastructure Provisioning"]
  node_ansible["Host Deployment<br/>[playbook.yml]"]
  node_docker_role["Docker Setup<br/>[main.yml]"]
  node_app_role["App Deployment<br/>[main.yml]"]
end

subgraph group_runtime["Application Runtime"]
  node_flask_app["Flask App<br/>[main.py]"]
end

node_developer(("Developer"))
node_github["GitHub"]
node_dockerhub[("Docker Hub")]
node_ec2["AWS EC2"]

node_developer -->|"pushes to"| node_github
node_github -->|"triggers"| node_jenkins
node_jenkins -->|"runs"| node_checkout
node_checkout -->|"then runs"| node_lint
node_lint -->|"then runs"| node_unit_tests
node_jenkins -->|"builds"| node_docker_build
node_docker_build -->|"pushes image"| node_dockerhub
node_jenkins -->|"optionally runs"| node_terraform
node_terraform -->|"provisions"| node_ec2
node_jenkins -->|"runs"| node_ansible
node_ansible -->|"configures and deploys"| node_ec2
node_ansible -->|"installs Docker"| node_docker_role
node_ansible -->|"deploys app"| node_app_role
node_dockerhub -->|"image pulled by"| node_ec2
node_ec2 -->|"runs"| node_flask_app
node_jenkins -->|"checks health"| node_smoke_test
node_smoke_test -->|"requests health"| node_flask_app

click node_jenkins "https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile"
click node_checkout "https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile"
click node_lint "https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile"
click node_unit_tests "https://github.com/tamil27092005/cicd/tree/main/tests"
click node_docker_build "https://github.com/tamil27092005/cicd/blob/main/Dockerfile"
click node_terraform "https://github.com/tamil27092005/cicd/tree/main/terraform"
click node_ansible "https://github.com/tamil27092005/cicd/blob/main/ansible/playbook.yml"
click node_docker_role "https://github.com/tamil27092005/cicd/blob/main/ansible/roles/docker/tasks/main.yml"
click node_app_role "https://github.com/tamil27092005/cicd/blob/main/ansible/roles/app/tasks/main.yml"
click node_flask_app "https://github.com/tamil27092005/cicd/blob/main/app/main.py"
click node_smoke_test "https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_jenkins,node_checkout,node_lint,node_unit_tests,node_smoke_test toneBlue
class node_docker_build,node_dockerhub toneAmber
class node_terraform,node_ansible,node_docker_role,node_app_role toneMint
class node_flask_app toneRose
class node_developer,node_github,node_ec2 toneIndigo
```

## Components

### CI/CD Pipeline

- [Jenkins](https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile): `Jenkinsfile`
- [Source Checkout](https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile): `Jenkinsfile`
- [Lint](https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile): `Jenkinsfile`
- [Unit Tests](https://github.com/tamil27092005/cicd/tree/main/tests): `tests`
- [Health Smoke Test](https://github.com/tamil27092005/cicd/blob/main/Jenkinsfile): `Jenkinsfile`

### Container Release

- [Image Build](https://github.com/tamil27092005/cicd/blob/main/Dockerfile): `Dockerfile`

### Infrastructure

- [Infrastructure Provisioning](https://github.com/tamil27092005/cicd/tree/main/terraform): `terraform`
- [Host Deployment](https://github.com/tamil27092005/cicd/blob/main/ansible/playbook.yml): `ansible/playbook.yml`
- [Docker Setup](https://github.com/tamil27092005/cicd/blob/main/ansible/roles/docker/tasks/main.yml): `ansible/roles/docker/tasks/main.yml`
- [App Deployment](https://github.com/tamil27092005/cicd/blob/main/ansible/roles/app/tasks/main.yml): `ansible/roles/app/tasks/main.yml`

### Application Runtime

- [Flask App](https://github.com/tamil27092005/cicd/blob/main/app/main.py): `app/main.py`

### Other components

- **Developer**
- **GitHub**
- **Docker Hub**
- **AWS EC2**

## Connections

- Developer → GitHub: pushes to (evidence: `README.md`)
- GitHub → Jenkins: triggers (evidence: `README.md`)
- Jenkins → Source Checkout: runs (evidence: `README.md`)
- Source Checkout → Lint: then runs (evidence: `README.md`)
- Lint → Unit Tests: then runs (evidence: `README.md`)
- Jenkins → Image Build: builds (evidence: `README.md`)
- Image Build → Docker Hub: pushes image (evidence: `README.md`)
- Jenkins → Infrastructure Provisioning: optionally runs (evidence: `README.md`)
- Infrastructure Provisioning → AWS EC2: provisions (evidence: `README.md`)
- Jenkins → Host Deployment: runs (evidence: `README.md`)
- Host Deployment → AWS EC2: configures and deploys (evidence: `README.md`)
- Host Deployment → Docker Setup: installs Docker (evidence: `README.md`)
- Host Deployment → App Deployment: deploys app (evidence: `README.md`)
- Docker Hub → AWS EC2: image pulled by (evidence: `README.md`)
- AWS EC2 → Flask App: runs (evidence: `README.md`)
- Jenkins → Health Smoke Test: checks health (evidence: `README.md`)
- Health Smoke Test → Flask App: requests health (evidence: `README.md`)
