Jenkins-as-code: creating jobs from the command line during development

In the previous post in this series, I covered how to make a seed job for seed jobs via registration. In this post, I’ll cover my favorite development-time helper: running job scripts from the command line. The problem As our team was working on adopting this jenkins-as-code solution, I confess that local development was suboptimal. Because seed jobs pull from source control and then process job dsls, we’d have to build the dsl scripts, push to git, run the seed job, and run the built jobs, repeating as necessary till the job was working as desired. The workflow was slow enough … Continue reading Jenkins-as-code: creating jobs from the command line during development

Jenkins-as-code: registering jobs for automatic seed job creation

In the previous post in this series, I covered custom builders we’ve added on top of job-dsl-plugin. In this post, I’ll cover an innovative solution that’s made working with all these Jenkins-as-code repositories much easier. It centers around a seed job for seed jobs. What are seed jobs again? The job-dsl-plugin tutorial covers them thoroughly. In short, a seed job processes your job-dsl scripts and thus creates the Jenkins jobs from those scripts using the “Process Job DSLs” build step. You generally configure your seed jobs to listen for changes to the source code repo where you keep your jobs, such … Continue reading Jenkins-as-code: registering jobs for automatic seed job creation

Jenkins-as-code: creating reusable builders

In the first post in this series, I covered the problems we were having with job creation and maintenance and a very high level look at our solution. In the second post, I covered the job-dsl-plugin which underpins our solution. In this post, I’ll dig into the Builders we’ve added on top of job-dsl-plugin, which do the following for us add sensible defaults for all jobs make it easy to do the right thing for potentially complicated jobs or configurations provide utilities for common decision-making and code blocks establish a Builders pattern for use internally even if a job type isn’t all that … Continue reading Jenkins-as-code: creating reusable builders

Jenkins-as-code: job-dsl-plugin

In the first post in this series, I covered the problems we were having with job creation and maintenance and a very high level look at our solution. In this post, I’ll go more in depth with the solution, covering the job-dsl-plugin. I’m not going to recreate others’ documentation here, so for actual instructions, I’ll simply link to existing docs. job-dsl-plugin I’m assuming if you’re reading this that you’re quite familiar with creating Jenkins jobs, point-and-click style, via the Jenkins GUI.  job-dsl-plugin is a Jenkins plugin that enables you to define Jenkins jobs in plain text, using a really nice Groovy-based … Continue reading Jenkins-as-code: job-dsl-plugin

Jenkins-as-Code: Creating Jenkins jobs with text, not clicks

This is the first in a series of posts on how we upped our Jenkins game by treating Jenkins jobs as code, rather than pointing-and-clicking to create jobs. In this series, I’ll cover: the problems we had as our Jenkins use scaled throughout the organization the target conditions we wished to achieve how we addressed those problems using the job-dsl-plugin along with some sugar on top what the development workflow looks like what a realistic set of jobs looks like for a sample project the sugar we built on top of job-dsl-plugin how we encouraged adoption of this approach across teams … Continue reading Jenkins-as-Code: Creating Jenkins jobs with text, not clicks