{"id":25521876,"url":"https://github.com/nihilantropy/basic-ci-cd","last_synced_at":"2026-04-05T22:34:37.044Z","repository":{"id":278376282,"uuid":"935415540","full_name":"Nihilantropy/Basic-CI-CD","owner":"Nihilantropy","description":"A basic CI/CD project to learn GitOps best practices and tools","archived":false,"fork":false,"pushed_at":"2025-04-14T11:20:59.000Z","size":444,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T12:51:24.387Z","etag":null,"topics":["argocd","docker","docker-compose","flux","gitlab","grafana","helm","jenkins","kubernetes","monitoring","nexus","prometheus","sonarqube","terraform"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nihilantropy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-19T12:08:37.000Z","updated_at":"2025-04-11T16:03:01.000Z","dependencies_parsed_at":"2025-04-10T09:21:49.770Z","dependency_job_id":"22d0197d-da89-4795-9a82-2dc691eb525c","html_url":"https://github.com/Nihilantropy/Basic-CI-CD","commit_stats":null,"previous_names":["nihilantropy/basic-ci-cd"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Nihilantropy/Basic-CI-CD","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2FBasic-CI-CD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2FBasic-CI-CD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2FBasic-CI-CD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2FBasic-CI-CD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nihilantropy","download_url":"https://codeload.github.com/Nihilantropy/Basic-CI-CD/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2FBasic-CI-CD/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259479618,"owners_count":22864364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argocd","docker","docker-compose","flux","gitlab","grafana","helm","jenkins","kubernetes","monitoring","nexus","prometheus","sonarqube","terraform"],"created_at":"2025-02-19T18:17:28.821Z","updated_at":"2026-04-05T22:34:36.964Z","avatar_url":"https://github.com/Nihilantropy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic CI/CD Pipeline Project\n\n![CI/CD Pipeline](https://img.shields.io/badge/CI%2FCD-Pipeline-blue)\n![Jenkins](https://img.shields.io/badge/Jenkins-v2.492.1-red)\n![GitLab](https://img.shields.io/badge/GitLab-CE-orange)\n![Nexus](https://img.shields.io/badge/Nexus-3-green)\n![Kubernetes](https://img.shields.io/badge/Kubernetes-Kind-blueviolet)\n![Terraform](https://img.shields.io/badge/Terraform-1.7.0-purple)\n![ArgoCD](https://img.shields.io/badge/ArgoCD-v2.8.0-lightblue)\n![Sonarqube](https://img.shields.io/badge/Sonarqube-9.9-blue)\n![Prometheus](https://img.shields.io/badge/Prometheus-v3.2.1-red)\n![Grafana](https://img.shields.io/badge/Grafana-11.5.2-orange)\n![License](https://img.shields.io/badge/License-MIT-lightgrey)\n\nA robust end-to-end CI/CD pipeline demonstrating modern DevOps practices through the integration of industry-standard tools. This project automates the complete software development lifecycle from code commit to production deployment and observability of a Python Flask application.\n\n\u003e **🔍 For detailed setup and usage instructions, please see [How to Use Guide](docs/how-to-use.md).**\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Core Principles](#core-principles)\n- [Architecture](#architecture)\n- [Key Features](#key-features)\n- [Components](#components)\n- [Workflow](#workflow)\n- [Directory Structure](#directory-structure)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [License](#license)\n\n## 🌟 Overview\n\nThis project showcases a complete CI/CD pipeline with integrated monitoring that automates the software development lifecycle. It leverages modern DevOps tools to create a scalable, maintainable, and secure solution for continuous delivery and monitoring of a Python Flask application.\n\nThe implementation focuses on DevOps best practices including:\n- Infrastructure as Code (IaC)\n- Containerization\n- Continuous Integration\n- Continuous Deployment with GitOps\n- Automated Testing\n- Code Quality Enforcement\n- Comprehensive Monitoring\n- Multi-Environment Support\n\n## 🧩 Core Principles\n\nThis project embodies several core DevOps principles:\n\n1. **Automation** 🔄: Eliminate manual processes through automation of building, testing, and deployment\n2. **Continuous Integration** 🛠️: Frequent code integration with automated verification\n3. **Continuous Delivery** 🚀: Reliable, low-risk deployments through automation\n4. **GitOps** 📝: Git as the single source of truth for infrastructure and application deployment\n5. **Shift Left** 🔍: Early testing, security scanning, and quality checks\n6. **Infrastructure as Code** 🏗️: Define and version infrastructure alongside application code\n7. **Observability** 📊: Comprehensive monitoring and metrics collection\n8. **Environment Parity** 🔄: Consistent configurations across environments\n\n## 🏛️ Architecture\n\nThe architecture integrates several key components:\n\n1. **Version Control (GitLab)**: Central repository for application code, Helm charts, and deployment configurations\n2. **CI Pipeline (Jenkins)**: Orchestrates building, testing, and artifact creation processes\n3. **Artifact Storage (Nexus)**: Securely stores versioned application binaries\n4. **Quality Gates (Sonarqube)**: Enforces code quality standards and test coverage\n5. **Infrastructure Provisioning (Terraform)**: Manages Kubernetes infrastructure declaratively\n6. **GitOps Engine (ArgoCD)**: Ensures deployment state matches Git definitions\n7. **Container Orchestration (Kubernetes)**: Manages application containers\n8. **Monitoring Stack**: Tracks application and infrastructure health and performance\n\nThe workflow connects these components into a seamless pipeline where code changes automatically flow through verification, building, and deployment stages while maintaining observability.\n\n## ✨ Key Features\n\n- **Complete CI/CD Automation**: End-to-end pipeline from code commit to deployment\n- **GitOps with ArgoCD**: App of Apps pattern for multi-environment deployments\n- **Infrastructure as Code**: Terraform-managed Kubernetes with reusable modules\n- **Multi-Environment Support**: Separate dev and prod configurations\n- **Advanced Flask Application**: Rate limiting, metrics collection, and health monitoring\n- **Comprehensive Testing**: Automated functional, security, and metrics tests\n- **Code Quality Enforcement**: Static analysis, security scanning, and Sonarqube integration\n- **Artifact Management**: Versioned binary storage with Nexus\n- **Containerized Development**: Docker Compose for consistent local environment\n- **Detailed Monitoring**: Prometheus metrics collection with Grafana dashboards\n- **Alerting**: Configurable thresholds with Alertmanager integration\n\n## 🧰 Components\n\n### 📝 Version Control with GitLab\n\nGitLab serves as the central source code repository, providing:\n- Version control for application code\n- CI/CD integration with Jenkins\n- Repository for deployment configurations\n- Separate branch for ArgoCD configurations\n\n### 🔄 Continuous Integration with Jenkins\n\nJenkins orchestrates the CI process with a pipeline that:\n- Runs automated tests with pytest\n- Performs static code analysis with Ruff\n- Conducts security scanning with Bandit\n- Analyzes code quality with Sonarqube\n- Builds application binaries with PyInstaller\n- Uploads artifacts to Nexus repository\n- Updates deployment configurations\n- Creates dedicated ArgoCD branch\n\n### 📦 Artifact Management with Nexus\n\nNexus provides a central repository for:\n- Storing versioned application binaries\n- Managing latest and timestamped releases\n- Providing a reliable artifact source for deployments\n\n### 🏗️ Infrastructure Management with Terraform\n\nTerraform enables infrastructure as code by:\n- Creating and configuring Kind Kubernetes clusters\n- Setting up ArgoCD with the App of Apps pattern\n- Managing Kubernetes resources with reusable modules\n- Connecting cluster to external services like Nexus\n\n### 🚀 GitOps Deployment with ArgoCD\n\nArgoCD implements GitOps practices by:\n- Using the App of Apps pattern for hierarchical management\n- Automatically synchronizing Git changes to the cluster\n- Supporting multiple environments (dev, prod)\n- Self-healing deployments that maintain desired state\n- Providing visibility into deployment status and history\n\n### ⚙️ Application Deployment with Helm\n\nHelm charts provide declarative application management:\n- Environment-specific configurations via values files\n- Consistent deployment templates\n- Support for versioned releases\n- Integration with Nexus for artifact retrieval\n\n### 📊 Monitoring with Prometheus and Grafana\n\nThe monitoring stack delivers comprehensive observability:\n- Application metrics from the Flask `/metrics` endpoint\n- Pipeline performance metrics from Jenkins\n- Container and system metrics from cAdvisor\n- Custom dashboards for different aspects of the system\n- Alerting based on defined thresholds\n\n## 🔄 Workflow\n\nThe CI/CD workflow follows these steps:\n\n1. **Code Commit** 📝: Developer pushes changes to GitLab main branch\n2. **CI Pipeline** 🧪: Jenkins tests, analyzes, builds and packages the application\n3. **Artifact Storage** 📦: Binary is versioned and stored in Nexus\n4. **GitOps Update** 🔄: Jenkins updates Helm chart and ArgoCD branch\n5. **Automatic Deployment** 🚀: ArgoCD detects changes and syncs applications to Kubernetes\n6. **Multi-Environment Deployment** 🌐: Applications deploy to dev and prod environments\n7. **Continuous Monitoring** 📊: Prometheus collects metrics from all components\n8. **Performance Visualization** 📈: Grafana displays real-time metrics and trends\n\nThis workflow embodies the principle of continuous delivery by providing a reliable, repeatable path to production with built-in quality gates and observability.\n\n## 📁 Directory Structure\n\n```\nbasic-ci-cd/\n├── appflask/                     # Flask application source\n│   ├── agent/                    # Jenkins agent configuration\n│   ├── appflask/                 # Application source code\n│   ├── argocd-apps/              # ArgoCD application definitions\n│   │   ├── apps/                 # App of Apps child applications\n│   │   └── helm/                 # Helm charts for applications\n│   ├── tests/                    # Test suites\n│   └── test_scripts/             # Monitoring test scripts\n│\n├── docs/                         # Documentation files\n│   ├── how-to-use.md             # Comprehensive usage guide\n│   ├── monitoring/               # Monitoring documentation\n│   ├── progresses/               # Project progress tracking\n│   └── subjects/                 # Project requirements\n│\n├── srcs/                         # Docker environment files\n│   ├── docker-compose.yaml       # Service composition\n│   └── requirements/             # Service-specific files\n│\n├── terraform/                    # Terraform configurations\n│   ├── environments/             # Environment-specific configs\n│   ├── modules/                  # Reusable modules\n│   │   ├── cluster/              # Kind cluster module\n│   │   └── k8s_resources/        # Kubernetes resources modules\n│   └── scripts/                  # Helper scripts\n│\n├── Makefile                      # Build automation\n└── README.md                     # This documentation\n```\n\n## 📚 Documentation\n\nComprehensive documentation is available in the `docs` directory:\n\n- **[How to Use Guide](docs/how-to-use.md)**: Detailed setup and usage instructions\n- **[Infrastructure Architecture](docs/Infrastracture_architecture.md)**: Monitoring system architecture\n- **[Monitoring Documentation](docs/monitoring/)**: Metrics collection setup and pipeline metrics\n- **[Code Standards](docs/STANDARD_CODE.md)**: Coding standards and guidelines\n- **[Technologies](docs/Technologies/)**: Documentation for GitLab, Jenkins, and Nexus\n- **[Project Requirements](docs/subjects/)**: Original project requirements\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\nDeveloped with ❤️ by [Nihilantropy]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihilantropy%2Fbasic-ci-cd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihilantropy%2Fbasic-ci-cd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihilantropy%2Fbasic-ci-cd/lists"}