Putting It All Together: The Building Blocks of a CI/CD Pipeline
From Code to a Running Application, Automatically
This final chapter of the ‘Ubuntu System Administration Guide’ brings together several automation concepts to form the building blocks of a complete CI/CD pipeline. A pipeline is simply a series of automated steps that take your code from a developer’s machine to a production environment.
The Pipeline Steps
The book demonstrates a simple but powerful two-stage pipeline:
- Build and Push: The first stage uses a bash script and Docker to build the application into a versioned container image and push it to a container registry. This creates the deployment artifact.
- Deploy to Kubernetes: The second stage uses Terraform to take that newly built image and deploy it to a Kubernetes cluster. Terraform’s `apply` command ensures the running application is updated to the new version.
By running all of these tools (Ansible, Docker, Terraform) from within a container, the entire pipeline becomes portable and can be easily executed by CI/CD platforms like GitLab or GitHub Actions, enabling a fully automated workflow from code commit to deployment.
This post is based from content of the book Ubuntu System adminstration guide. And the book can be found here https://www.amazon.com/stores/Mattias-Hemmingsson/author/B0FF5CQX13