Build Automation

Embedded Artistry Jenkins Pipeline Library

I'm excited to announce a new Embedded Artistry GitHub repository: jenkins-pipeline-lib

I've been overhauling our Jenkins build server setup to use pipeline multi-branch builds. I like the pipeline format: I'm thrilled that build stages are defined in a file that is stored under SCM with the source code. Developers can look at the commands being run and debug them locally, rather than trying to figure out how the build server works.

Since I support a large number of repositories, I created a pipeline library to contain common functionality and reduce bring-up time for new projects. Functionality includes:

  • Sending email notifications
  • Sending slack notifications
  • Retreiving the build log
  • Retreiving the git change log
  • Retreiving the git commit hash
  • Convenience functions for git tagging
  • Setting GitHub commit status
  • Filling GitHub issues

Using the Pipeline Library

I recommend forking the library so that updates don't surprise you by breaking your builds.

In order to use this pipeline library in your own projects, please see the Extending with Shared Libraries Jenkins documentation.


For example pipeline files which use this library, refer to the following repositories:

Further Reading:

An Improved Jenkins SCM Sync Configuration Plugin

One of my favorite Jenkins plugins is the SCM Sync Configuration plugin. There have been multiple occasions where I have made a change to a project configuration only to break the build. When that happened, there was no way to undo the changes and revert back to the previous configuration.

The SCM Sync Configuration plugin is a godsend, as all of your configuration settings are backed up to an SCM system (git, in my case). If you make a bad change, you can revert to an older commit or simply use the repository as a reference to manually undo your changes.

Unfortunately, if you use the mainline plugin you will find that syncing no longer works once you've deleted a job. This can be especially problematic if you are using multi-branch pipeline builds, as jobs are regularly created and deleted to correspond with active branches and pull requests.

Since the plugin seems to be currently unmaintained, I forked the repository and included fixes from elsewhere on the web. Using this new plugin version, I am happy to report that all of my SCM syncing woes have been solved.

Below I'll describe how to use my version of the SCM Sync Configuration plugin on your own Jenkins instance.

GitHub Repository

The Embedded Artistry SCM Sync Configuration plugin is hosted on GitHub. As a shortcut, here is a handy git clone reference:

git clone


My local Jenkins instance generates plugin images. I have decided to use the GitHub releases feature to distribute binaries. If you would like to use a pre-generated plugin image, simply download the scm-sync-configuration.hpi plugin from GitHub.

Manually Building the Plugin

If you'd prefer to build locally, the process is quite simple.

First, you'll need to install Maven. Once installed, the plugin can be built by issuing the following command:

mvn install

After the build is complete, the plugin can be found at ./target/scm-sync-configuration.hpi

Installing the Plugin

If you have the existing plugin installed, uninstall it from using the Jenkins plugin manager. Then follow the instructions below to manually install scm-sync-configuration.hpi from the Jenkins web interface.

Assuming a .hpi file has been downloaded, a logged-in Jenkins administrator may upload the file from within the web UI:

  1. Navigate to the Manage Jenkins > Manage Plugins page in the web UI.
  2. Click on the Advanced tab.
  3. Choose the .hpi file under the Upload Plugin section.
  4. Upload the plugin file.

You can review the Managing Plugins documentation for further information and other approaches to installing the plugin.


Announcing ea-jenkins Repository

I want to announce a new repository: ea-jenkins.

ea-jenkins contains an example Jenkins build server configuration. This configuration can be imported into your own Jenkins build server to get you up and running quickly. I recommend forking this repository for your own development purposes.

Importing the ea-jenkins Configuration

To utilize this base config with Jenkins, you need to:

  1. Setup Jenkins
  2. Install the SCM Sync Configuration plugin
  3. Fork ea-jenkins
  4. Go to Manage Jenkins -> Configure System
  5. In the "SCM Sync configuration" section, select "git" and point it to your forked repository
  6. Click "Reload" to import the settings from your git repo.