CI/CD setup in just 5 mins with basic yaml configuration

Overview
Enterprises are making their moves toward DevOps methodologies and Agile culture to accelerate the delivery speed and ensure product quality. In DevOps, a continuous and automated delivery cycle is the backbone that makes fast and reliable delivery possible.As the number of deployments and teams grows so does the complexity of managing them. In this blog I have talked about self serve CI/CD capability for the enterprise projects.
Motivation behind this
- Increase development velocity by providing templates for builds and deployments.
- Reduce variation in how different code bases are released to production.
- Centralized and versioned pipelines for use across engineering.
- Improvements made in one location can help everyone.
- Customize pipeline steps based on input from a local configuration.
- Reduce time to production.
- Reduce shoulder taps for DevOps
Introduction
We have two repositories in our current project
- First repository is for the jobs and we have used Jenkins Job Builder application that allows us to write Jenkins jobs with yaml files and load them into Jenkins.
- Second repository is for the shared libraries.This repository contains all the shared libraries and pipelines that we have developed for our CI and CD needs. Thus making our pipelines more ‘DRY’ (Don’t Repeat Yourself).The repository follows the structure of Jenkins Shared Libraries.
In this case, we are splitting responsibilities between Developers and DevOps and each team takes full responsibilities of their own components. However, it results in a project being split into two different locations.
First Repository ( Jenkins Job builder)
Jenkins Job Builder is a command-line utility that will create Jenkins jobs based upon YAML configurations.
New team has to write their requirement in yaml format . Build and Deploy yamls for one team is shown below.

We have written our job templates which will be use by the above projects. Build and Deploy templates is shown below.

Second Repository ( Shared Library)
Jenkins Shared Libraries allow you to define and share pipeline code between projects. This is exactly what we needed.
Structure of Jenkins Shared Library repository

- vars — this is where you put all of your global functions, the ones you will call from your project templates. For us, this is where the vast majority of our code lives
- src — This is a regular Java-style source code directory. All source code and classes in here can be imported into your pipeline using an import statement.
- resources — Any supporting resources for your library will go here.
Job Seeder pipeline
Job seeder pipeline will create jobs by polling jenkins job builder repository and running job builder commands to create/update/delete jobs.
Final Flow:
