Since the last blog post post we did some updates in our Jenkins environments and today I’m going to talk a bit about it. We are using a Gradle Jenkins plugin to control the Jenkins installation.

“Why did we change it?” you may ask. For the other plugin you need to create a seed job, and at ePages, we have quite a complex structure with a few shell scripts. Some of those shell scripts are shared on the company level, so before changing them, we want to make sure they work properly. (Testing phase!)

Another advantage of this plugin is that it is easy to deploy. For instance, I didn’t want to break our Team Jenkins installation, so I run an instance of Jenkins in a docker container and deploy my playground scripts to it.

## How to set up the project

Look at the following sample snippet:

Note: This will not setup a Jenkins for you! It will only authenticate with your own instance!

## How to use the plugin

I was using my local Jenkins. After doing the proper changes on the DSL, I just need to trigger the task updateJenkinsItems.

To use it, simply create a gradle project and copy the snippet. On the project folder you could use:

This will provide you the list of available tasks.

This will validate local changes with your Jenkins.

This will update your Jenkins installation with the DSL defined locally.

## Conclusions

This plugin is really powerful, and there are many cases where you could use it to empower your jobs/automation environment. I hope this blog post illustrates the application examples of this plugin. If you want to know more about the other jobs, have a look at complete documentation on the project wiki.

• We have our Jenkins jobs under a source control system (git).
• We can recreate our Jenkins instance pretty fast and test locally without effecting the rest of the team.