← Back to blog

Building a GitOps CI/CD Pipeline from Scratch

Building a GitOps CI/CD Pipeline from Scratch

When I started my homelab journey, I wanted a CI/CD setup that mirrored what I work with professionally. This post walks through the full stack: GitLab CE for source control, Jenkins for pipeline execution, and Ansible for configuration management.

The Stack

  • GitLab CE running on a dedicated VM acts as the single source of truth.
  • Jenkins (controller + worker) handles pipeline orchestration. Pipelines are defined in a shared library so every repo inherits the same structure.
  • Ansible roles handle idempotent configuration of every VM.

Lessons Learned

The biggest win was treating the shared library as a first-class artifact with its own tests and versioning. When a pipeline behaviour needs to change, one MR propagates it everywhere.