Four essential Jenkins plugins
Thinking of ways you can up your CI/CD game? Check out these super-useful Jenkins plugins!
Up your CI/CD game with these useful add-ons.
Jenkins has become a critical component of the edit-build-test lifecycle at many companies. In large part that’s due to Jenkins’s ability to handle a large variety of project types, from vanilla Java code to complicated iOS applications. If you aren’t using this automated build tool as part of your infrastructure, you owe it to yourself and your team to give it a look.
But as powerful as Jenkins is out of the box, there are plugins you can add that make it even more useful. Here’s my personal top four.
Before we dive into the specific plugins, it’s worth noting how to install them. Thankfully, adding plugins is easy.
First, log into Jenkins as a user with the appropriate administrative authorization. You see an item labeled “Manage Jenkins” on the left-hand side menu. Select that option.
One option you are presented with is “Manage Plugins.” This is the gateway to installing and upgrading plugins on your installation.
Now that you know how to install plugins, let’s get to the good stuff.
It’s possible you’re one of those unlucky folks using a legacy source control systems; at a previous employer, we were literally the last customer of the SCM vendor left on the planet. However, almost everyone has adopted Git by now. And without the basic Git plugin for Jenkins, the tool loses most of its value.
Once you installed the Git plugin, Jenkins can monitor your git repo for changes and automatically fire off builds when there are new commits. That puts the continuous in CI/CD.
Of course, once it notices a change, the Jenkins plugin can also check out the project sources, using your choice of a fresh clone or an incremental update.
If a build fails in the forest, and no one is there to see it, did it really fail at all? If failed builds languish unnoticed in your group, this plugin is just what the CI/CD doctor ordered. (This assumes your team uses Slack, of course.)
The Slack notification plugin is highly configurable. You can send a custom message to a designated Slack channel on a number of different events. Want to blast out a message whenever there’s a unit test failure, complete with the identity of the last person to do a check-in? Can do! But that’s just the start of what this versatile tool can provide. My favorite use in our group is to send out a message after a successful build with direct download links for the installable artifacts, stored on our S3 bucket. Which brings us to…
These days, many projects host their sources on Github, either using the public cloud version, or a private enterprise instance. While just using the git plugin lets you use Github-based repos, adding the Github-specific plugin buys you a lot more.
For one thing, it allows a post-commit POST hook on Github to trigger a build on your Jenkins server, rather than having to periodically poll the git repo for changes. The plugin can also report build status to Github, letting you use Github as your dashboard for build health rather than relying on Jenkins.
Cobertura plugin (or similar coverage plugins)
Cobertura is specific to Java, but no matter which programming language you use, you can find Jenkins plugins that produce visually interesting and informative reports of code coverage from your unit tests. (You are unit testing as part of your CI/CD process, aren’t you?)
You can view these reports on the Jenkins dashboard for the build. Some plugins can integrate with the built-in email capabilities to deliver them as part of the post-build status.
I like these plugins, but not enough for me to insist that you install them. Then again, your needs may be different from mine. See if they might help your team.
Out of the box, Jenkins keeps the artifacts it creates on the local server. But often, you’d like to put those artifacts (especially build images that folks might to install) on something more public.
A popular choice is to send them to an Amazon S3 bucket with a static website enabled. You can play around with shell scripts to transfer files after a build succeeds, but the S3 Publisher plugin allows you to specify a bucket to which you save build artifacts, and can automatically upload them after the build succeeds.
Not everyone creates iOS or MacOS binaries, but if you do, the Xcode plugin is the only game in town to get Jenkins in charge of your builds. It can handle everything from keychain authorization and provisioning profile management to build schemes.
Of course, if you’re going to go this route, you need to run the Jenkins build on a Mac. A couple of Mac Minis make a nice build farm for this purpose, or maybe grab a new maxed-out Mac Pro if you light your fireplace with $100 bills.
Matrix Authorization Strategy
The Matrix authorization plugin is a bit “inside baseball,” as it really only benefits your friendly neighborhood Jenkins administrator. However, it’s almost a must-have for any server that is used by more than a few people. It lets you configure fine-grained access control on a project-by-project level, so that Joe from project A can start up builds for his project, but he cannot start Jane’s builds for project B.
From simple scripts to recorders, and systems that use artificial intelligence, test automation allows testing to be done at scales that were impossible just a few years ago. Learn the five levels of test automation and discover where your organization stands.