9 plugins to enhance your Jenkins experience

Maxence Terpan
Esker-Labs
Published in
7 min readFeb 15, 2021
Image by PIRO4D on Pixabay

Here at Esker, we use Jenkins to automate our builds and to launch our automated tests. Each team has a different Jenkins server dedicated to its tests, and we have another one linked with our Github repository to build our product.

I’m not a Jenkins expert, but I had the opportunity to play with some settings in our own Jenkins in my team. I selected some tips that ease our daily work with this amazing tool. This is not an exhaustive list, but I hope it will help you make your Jenkins better 😊

Pimp Your Jenkins: Simple Theme

We all agree that Jenkins is a very powerful tool that allows us to do almost everything we want. But its interface can be a little... austere, to be kind. But the thing is that it is entirely customizable!

If you want to go for the simple solution, here are the steps to make your Jenkins look great:

  1. Go to your Jenkins plugins configuration and install Simple Theme plugin
  2. On your Jenkins home page, click Manage Jenkins, then Configure System.
  3. Scroll down to Theme. Here, you can set a CSS URL. Several are available on the web, but the one that we currently use can be found here.
  4. Just apply your changes, and here you go! You have a totally new Jenkins interface:
Standard Jenkins interface
Standard Jenkins interface
Improved Jenkins interface
Improved Jenkins interface

If you want to go a little further, you can apply your own customizations on this CSS. Just use the Extra CSS field below the CSS URL to put your custom CSS.

Take shortcuts : Keyboard Shortcuts

The large number of menus and pages in Jenkins can make it a nightmare to navigate in. To help you access these pages a little quicker, you can use the Keyboard shortcuts plugin. To do so, just install it via the Plugins manager page of your Jenkins, then you will be able to use a wide variety of shortcuts on any page (the full list can be found on the link above).

Some shortcuts available with Keyboard Shortcuts plugin
Some shortcuts available with Keyboard Shortcuts plugin

Fix your broken pipes : Pipelines

If you want to set up a complex workflow with parallel or conditional steps, pipelines could be the solution you are waiting for. Pipelines are a set of built-in plugins allowing you to orchestrate your deployment or any other complex task you want.

Simple pipeline with Blue Ocean interface
Simple pipeline with Blue Ocean interface

Pipelines can be easily implemented with Groovy script, and are deeply linked with the new interface for Jenkins named Blue Ocean. If you are interested in setting up this kind of job, you should definitely head up to this page.

Automatically take the red pills : Matrix Reloaded

If you have some matrix jobs, one of the most annoying thing is that you can’t choose which specific jobs you want to build. Matrix Reloaded plugin allows you to do that, and that can be very useful when you have some unstable tests to relaunch :

After installing the plugin through the Plugin manager page, you will have a button to rebuild your matrix on each build already finished. By default, the selected jobs will be the “unstable” and “not run” ones.

Gain more views : Sectioned View and View Job filters

If you feel that simple views are not enough, then try these two plugins :

  • Sectioned View will allow you to create a view with multiple sections in it : folder listing, job graphs, views, test result, Texts… You can organize these sections as you want, giving you the opportunity to create a real dashboard for your team, with tests, builds, tools, virtual machines managements… The only limit is your imagination !
  • View Job filters plugin is very useful to filter job views by various means : regular expressions, filter by configured parameters, job type, jobs or build status, jobs in another view… Combined with the Sectioned View plugin, you can display not only the views you want, but also the jobs in each of these views.

In our team, it allows us to create a view which displays only the unstable and failed automated tests at the top of our “dashboard”. On the same page, we also have the list of all the tests we maintain, and on the right, some tasks we frequently use for our virtual machines. Everything is visible at a glance, which is really pleasant !

Go straight to the point : Extra columns and Compact columns

Merging views are great, but displaying the needed information is better! Extra columns will help you with that. After installing it, this plugin will add a lot of columns to display : build description, duration, parameters, buttons to configure the job, to access the last log, the last node on which the job has been build, the test result… and so on.

But having all these relevant pieces of information in only one view can be hard to understand in one glance when there is a lot to display. To avoid having too much columns in your view, you can use Compact columns plugin, which will also add some new columns to display for your views, but in a “compact” way. For example, within only one column, you will be able to know when the last success/failed/unstable builds of a job happened, and access it right away, instead of using three columns to do that. It offers also a compact column to display the name of the project with some cool additions: the name is colored by its last status, the tooltip shows you useful information on the last build…

Hovering the job name gives you the last build’s information. The column “Last Statuses” let you see when the job failed for the last time, its last success…
Hovering the job name gives you the last build’s information. The column “Last Statuses” let you see when the job failed for the last time, its last success…

Below is an example of a view you can build using these two plugins: here you can see the console log button, a compact column to display the last statuses of the job, and a button to activate/deactivate the job.

Automate your automation : Job DSL

Last but not least, after adding a lot of different jobs to your Jenkins, you will have to maintain it. It can be hard and time consuming to do so when you have a lot of jobs to take care of… Unless one plugin helps you with that.

We recently discovered in our team the Job DSL plugin (although this is not a recent one). We had a lot of jobs that were almost identical, so each time we had to make a change in one of these jobs, we had to go through all of the list of jobs to make the same modifications. It used to take a lot of time to do so, and these changes were not saved anywhere, so if our Jenkins needed to be rollbacked for one reason or another, we had to do everything again…

This is where Job DSL’s plugin comes into play. The plugin allows us to define our job in a programmatic language, so you can automatically create jobs, views, pipelines… with the configuration you want. For example, you can generate a pipeline with the following code :

pipelineJob('job-dsl-plugin') {
definition {
cpsScm {
scm {
git {
remote {
url('https://github.com/jenkinsci/job-dsl-plugin.git')
}
branch('*/master')
}
}
lightweight()
}
}
}

To setup and use DSL scripts, you just have to create a new job, with a build step ‘“Process job DSLs”, then copy your DSL code into the “DSL script” field. If you want to version your jobs, you can also load your script from a file versioned in your Jenkins server. This “seed” job, when it will be launched, will generate one or more jobs depending on what you put in your DSL script.

If you want to create a DSL script from scratch, the DSL API is easily accessible directly from your Jenkins installation at https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html. But you can also create your view/job from the Jenkins interface, then export it to a DSL file by using the XML Job to Job DSL plugin. This plugin, when installed, will add a button to generate the DSL script for your current page, providing a nice base script to play with. You will probably have to check it and modify it a bit, since the export doesn’t support all the DSL tags.

I hope these tips will help you to enhance your Jenkins experience! If you want to dig deeper into the subject, there is a lot of other useful plugins to discover, you can see the complete list in the Jenkins plugin page.

--

--