Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Gitops For Jenkins Jobs
Rating: 4.8 out of 5(7 ratings)
56 students

Gitops For Jenkins Jobs

Automate jenkins job creation using job-dsl plugin
Last updated 11/2023
English
English [Auto],

What you'll learn

  • Generate jenkins jobs programatically using job-dsl plugin
  • Enable multiple job templates using groovy classes
  • Enable support for dynamic environments per job
  • Segregating jobs inside logical folders

Course content

1 section • 15 lectures • 2h 5m total length
  • Introduction4:46

    Enable GitOps to automate Jenkins job creation using YAML definitions in a GitHub repository. Push changes and merge PRs to auto generate Jenkins jobs with configurable environments and stages.

  • Things Needed1:13

    Learn to set up a Jenkins instance with Docker, install the Job DSL plugin, and prepare a Git repo with Groovy code to templatize pipeline configurations.

  • Jenkins setup using docker3:25

    Spin up a Jenkins LTS instance with Docker, run in background, expose port 8080, mount Jenkins home, install default plugins including Job DSL, and create admin user.

  • Job DSL plugin setup4:14

    Install and configure the job DSL plugin in Jenkins, create a seed job with a DSL script, and handle script security to generate new jobs.

  • Git repo setup and dsl job4:45

    Set up a git repo with a Groovy main.groovy for a simple job, configure Jenkins with the Job DSL plugin, and generate jobs from the repository.

  • Combining multiple jobs3:50

    combine multiple jobs by loading all groovy scripts via wildcard, enable cron-based auto-trigger on git changes, generating two Jenkins jobs named job one and job two.

  • Delete removed jobs4:00

    learn to keep Jenkins jobs in sync with your Git repository by enabling deletion of removed jobs in the seed configuration, triggering automatic cleanups and scaling considerations.

  • Scaling things using groovy3:54

    Scale Jenkins jobs by dynamically generating them with groovy templates, using a main.groovy entry and seed job to create yaml pipelines.

  • Reading data from yaml files14:23

    Discover how to read yaml data in Jenkins seed jobs with SnakeYAML, search and parse yaml files, and generate dynamic jobs from a template using yaml-defined properties.

  • Segregating code12:15

    Segregate code by introducing a utils package and a job utils class with a constructor, moving yaml parsing into the utility, and using get job name in main groovy.

  • Support for different environments11:15

    Enhance Jenkins pipelines by using YAML-driven templates to deploy to dev, qa, and production, while leveraging Groovy and Job DSL to generate dynamic pipeline jobs.

  • Dynamic environment selection11:15

    Learn to make Jenkins deployment templates dynamic by selecting environments at runtime using a Groovy script and YAML-defined env lists, enabling per-pipeline control over dev, qa, and prod stages.

  • Job templates17:17

    Implement multiple job templates in Jenkins with Groovy and YAML, organizing templates for deployment across Kubernetes environments and Maven repository deployment via dynamic job types.

  • Job name same as file name6:51

    Derive the job name from the file name using a global file path in the get_job_name function, replacing yaml parameters with names like job one, job two, and job three.

  • Moving jobs inside folders21:56

    Organize Jenkins jobs by creating a folder hierarchy from the git repository directory structure, using seed jobs and job-dsl to auto-create folders and place jobs under verticals, projects, and teams.

Requirements

  • Basics are Jenkins are needed for this course
  • You should know how to create a pipeline job in jenkins
  • Basic knowledge of any programming language
  • Basics of git

Description

In the DevOps World, Jenkins is one of the best cards on the table. In this course, I will demonstrate how we can generate Jenkins jobs using the Jenkins job-dsl plugin. With the help of some groovy code, I have unlocked different dimensions of dynamic job creation where you can have the following features.

  1. Ability to generate jobs using the YAML configurations.

  2. Feature for supporting different job templates such that the framework can fit into any organization.

  3. Ability to select environments dynamic for every job.

  4. Organizing the jobs in a better way such that it is easier to manage and maintain.

This course is for those who:

  1. Knows what is Jenkins.

  2. Knows how to create a pipeline job in Jenkins.

  3. Wanted to automate the Jenkins job creation using the gitops way.

  4. wanted to automate Jenkins job creation such that it can be onboarded on the developer portal.

This course is not for:

  1. Learning basics of Jenkins.

  2. Learning how to create a pipeline job.

  3. How to deploy my application on Kubernetes.

  4. How to deploy a Java/node application using Jenkins pipeline.

Start automating everything, and become a DevOps Master!

Are you interested in venturing into a new world full of agile technologies?

This is the right course for you!

Who this course is for:

  • Devops engineers who want to achieve next level of automation for jenkins job creation.