Jenkins-as-code: comparing job-dsl and Pipelines

In the previous post in this series, I covered my favorite development-time helper: running job scripts from the command line. In this post, I’ll cover the differences between job-dsl and Pipelines, and how I currently see the two living together in the Jenkins ecosystem. job-dsl refresher If you’re coming into this post directly, without reading the preceding articles in the series, I strongly encourage you to start at the start and then come back. For the rest of you, a quick refresher: job-dsl is a way of creating Jenkins jobs with code instead of the GUI. Here’s a very simple example: View the code … Continue reading Jenkins-as-code: comparing job-dsl and Pipelines

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