Skip to content

Latest commit

 

History

History
152 lines (105 loc) · 4.45 KB

File metadata and controls

152 lines (105 loc) · 4.45 KB

DevOps Sandbox

A comprehensive sandbox environment for DevOps automation and GitOps-driven CI/CD pipelines using GitHub Actions, with Kubernetes deployments built and tested inside a DevContainer.

Overview

This repository serves as a learning and experimentation platform for modern DevOps practices, including containerized applications, infrastructure-as-code, automated testing, and deployment pipelines.

Features

  • CI/CD Automation: GitHub Actions workflows for automated testing, building, and deployment
  • Kubernetes Integration: k3d setup scripts for lightweight Kubernetes clusters
  • DevContainer Support: Consistent development environment using VS Code DevContainers
  • Pre-commit Hooks: Git hooks configured for enforcing conventional commits and code quality
  • Docker Image Publishing: Automated container image builds and pushes to registries
  • Release Management: Release-please for automated versioning and changelog generation
  • Full-Stack Application: Study tracking application with frontend (web) and backend (API) components

Project Structure

.
├── .devcontainer/          # DevContainer configuration for VS Code
├── .github/workflows/       # GitHub Actions CI/CD workflows
├── kubernetes/             # Kubernetes manifests and k3d setup scripts
├── scripts/                # Utility scripts for automation
├── src/                    # Application source code
│   ├── backend/           # API backend (Python)
│   └── frontend/          # Web frontend (HTML/CSS/JS)
├── .gitignore            # Git ignore rules
├── .pre-commit-config.yaml # Pre-commit hooks configuration
├── mise.toml             # Mise (tool versioning) configuration
├── release-please-config.json # Release automation config
└── README.md             # This file

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Git
  • VS Code (for DevContainer support) or any text editor
  • kubectl (for Kubernetes interactions)

Development Setup

Option 1: Using DevContainer (Recommended)

  1. Clone the repository:

    git clone https://github.com/aadil96/devops.git
    cd devops
  2. Open the project in VS Code

  3. Click "Reopen in Container" when prompted

Option 2: Local Setup

  1. Clone the repository:

    git clone https://github.com/aadil96/devops.git
    cd devops
  2. Install dependencies using mise:

    mise install
  3. Install pre-commit hooks:

    pre-commit install

Technologies Used

  • Languages: Python (79.2%), Shell (10.9%), Dockerfile (5.2%), HTML (4.7%)
  • Container Orchestration: Kubernetes (k3d)
  • CI/CD: GitHub Actions
  • Container Runtime: Docker
  • Development Tools:
    • Pre-commit for git hooks
    • Mise for tool versioning
    • Release-please for release management

Workflows

This project includes automated workflows for:

  • Linting and code quality checks (Ruff)
  • Testing with pytest
  • Docker image building and publishing
  • Kubernetes deployment and testing
  • Automated releases with changelog generation

Applications

Study App

The repository includes a full-stack study tracking application with:

  • Frontend: study-app-web - Web interface for the study tracking application
  • Backend: study-app-api - REST API backend for the application

Both services are containerized and can be deployed using Kubernetes manifests in the kubernetes/ directory.

Releases

Current releases are available at Releases.

The project uses Release-please for automatic versioning and changelog generation.

Contributing

When contributing to this project:

  1. Follow Conventional Commits for commit messages
  2. Pre-commit hooks will help enforce these standards
  3. Ensure all tests pass before submitting a pull request
  4. Update documentation as needed

Git Hooks

This project uses pre-commit hooks to:

  • Enforce conventional commit messages
  • Run linting checks
  • Format code automatically

Hooks are configured in .pre-commit-config.yaml.

Kubernetes Deployment

To deploy using k3d:

cd kubernetes
./setup.sh  # Sets up k3d cluster and applies manifests

See the kubernetes/ directory for detailed deployment instructions and manifests.

License

This project is open source. See LICENSE file for details.

Author

aadil96