Skip to content

akuldevali/DevopsProject

Repository files navigation

DevOps CI/CD Pipeline Project

Team Information

Akul Gopal Devali - adevali


Problem Statement

Modern software development teams face significant challenges in maintaining performance, consistency and reliability across deployment pipelines. Manual deployment and inconsistent environments often result in delayed feedback, regression bugs, and service downtime. These issues hinder continuous delivery and reduce confidence in production deployments.

My proposed solution is a fully automated CI/CD pipeline built for the coffee-project Node.js application. The pipeline ensures reliable, consistent and performance validated deployments using a combination of Ops tools. By implementing a GitFlow branching strategy, the pipeline enforces strict code quality gates (linting and testing), provisions identical environments, and performs blue-green deployments to eliminate downtime. Performance regressions are detected early through automated testing in staging, while manual approvals add reliability to production releases.

This solution minimizes human error, provides traceable releases, and ensures every deployment is both performant and consistent.

Tagline: “Delivering reliability at the speed of automation - every commit, every environment.” (GPT5)


Use Case: PR to release branch triggers automated CI/CD pipeline with performance validation and controlled deployment

1. Preconditions

  • Main branch is protected; merges only allowed via approved PRs from release/*.
  • GitHub Actions workflows, Ansible playbooks, Docker configurations and k6 scripts are defined.
  • The development environment and staging hosts are provisioned.
  • Pre-commit hooks are configured locally on developer machines.
  • Webhooks configured for notification on any failure.

2. Main Flow

  1. A developer commits code to a dev/feature branch. [S0]
    • Pre-commit hooks run ESLint and Prettier checks locally to enforce style and syntax standards. (Static Analysis)
    • npm audit checks for dependency vulnerabilities. (Shift left security approach)
  2. Developer initiates a Pull Request (PR) from the dev/feature branch to the release branch. [S1]
  3. GitHub Actions automatically triggers the CI pipeline to: [S2]
    • Run unit, integration tests and build validation.
    • Gitleaks scans for secrets in the repository. (Shift left approach again)
  4. On successful CI completion, the CD pipeline starts:
    • Ansible provisions or updates the staging environment. [S3]
    • The containerized application is deployed to staging. [S4]
  5. k6 performance (load) tests are executed against the staging environment to detect regressions. (Performance Gates) [S5]
  6. If all checks pass, manual approval is required for promotion to production. (Gatekeeper) [S6]
  7. Upon approval, the pipeline performs a blue-green deployment, routing traffic to the new (Green) version. [S7]
  8. The main branch is updated and tagged to reflect the successful release. [S8]

3. Subflows

  • [S0] Developer commits and runs pre-commit hooks locally.
  • [S1] Developer creates a PR message and requests review from the Release Engineer (Diff time).
  • [S4] Docker image built and deployed automatically to staging container.
  • [S5] k6 benchmark results are compared against historical baselines for performance consistency. (Non functional requirement)
  • [S8] Tag creation triggers version update and closes the release cycle.

4. Alternative Flows

  • [E0] Lint or Prettier or Security Audit check fails → commit rejected locally.
  • [E1] Unit tests or Gitleaks fails → PR blocked. developer notified.
  • [E2] Tests fail → GitHub Action fails, PR blocked.
  • [E3] k6 performance tests show regression → deployment halted. release rejected.
  • [E4] Manual approval denied → promotion to production skipped. staging retained.
  • [E5] Production deployment fails → rollback triggered manually to prior stable container. webhook alert sent (Highly Unlikely).

Pipeline Design

flowchart LR
    %% Continuous Integration (Top lane)
    subgraph CI [Continuous Integration]
        direction LR
        A[Developer Commit:] --> B[Pre-commit Hooks: ESLint + Prettier + npm audit]
        B --> C[Push to dev Branch]
        C --> D[CI Pipeline: Unit Tests + npm audit]
        D --> E[Security Scans: Gitleaks]
        E --> F[PR to release/* Branch]
    end

    %% Continuous Deployment (Bottom lane)
    subgraph CD [Continuous Deployment]
        direction LR
        G["Ansible Deploy to Staging Env"] --> H[k6 Performance Test in Staging]
        H --> I[Manual Approval for Production]
        I --> J["Blue-Green Deployment in Production (Green)"]
        J --> K["Switch Traffic to Green Container"]
        K --> L[Merge release/* into main + Tag Release]
        J --> M[Deployment Failure?]
        M -->|Yes| N["Shift traffic to old (Blue) Container"]
        M -->|No| O["Build Promotion"] 
        L --> O
    end

    %% Connect CI to CD
    F --> G
Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors