For a long time now we have been using Jenkins as our CI system. This has been fine from a build process perspective, but it hasn’t been without its

Git-Notes Your CI Process

submited by
Style Pass
2021-06-13 08:00:04

For a long time now we have been using Jenkins as our CI system. This has been fine from a build process perspective, but it hasn’t been without its problems. One of the most annoying problems we’ve run into is losing build history. We typically tell Jenkins to keep around 10 or so previous builds. But once they roll off that information is gone forever. Now we could just increase or remove the limit entirely, BUT, hard drive space isn’t limitless and as more history is created Jenkins takes longer and longer to render the build pages. Also, the more history you retain the more memory (RAM/JVM Heap) Jenkins needs. Ideally, we’ve always attempted to treat Jenkins as an ephemeral resource.

Git has a little utilized feature known as Git Notes that allows you to attach meta-data to any commit without changing the original commit hash. This is perfect for us since we try to kick off a build on every commit and would like to know the result of those builds in-line with the original commits. Now, git-notes is not without its detractors, but with a little work we can utilize this feature to store build information for all builds within the Git Repository itself.

First, we need to setup our CI process to publish the build information at the end of the build. Seeing as we use Jenkins this guide will focus on that but most any build system should be able to accomplish this.

Leave a Comment