initPipeline_JenkinsPlugin, Open-Sourced

I wrote a jenkins plugin while I was idle between Oath and my current gig.

This plugin is a simplification of Oath’s (AOL’s) CICD Discover plugin. Re-written from scratch. Instead of crafting java code in the plugin, I walked it back to its origins, where it sends execution to an external executable.

The impetus to this plugin was laziness. Seriously. I worked alongside “Release Engineers”, back not long ago when that and “QA Engineers” was a thing. A good part of their job was to hand hold developers and make and configure Jenkins jobs to work with their code. I wanted to avoid that by having Jenkins configure pipeline jobs for itself, with no DevOps (the replacement for “Release Engineering” and “QA Engineering”, at least in part) involvement in manual configuration.

The git-plugin (written in java) had to have the code to achieve that somewhere – the plugin takes in a /git/notifyCommit?url= from a repo server, then checks its build history and determines what to build directly from the repo, then kicks off the build.

In GitStatus.java I found two blocks of code, !scmFound and !urlFound, where the plugin dropped the notifyCommit onto the floor because Jenkins did not have the job configured.

The point where git-plugin listens is extendable in Jenkins. So I stole much of the framework for the GitStatus.java (actually, under an MIT license, I can’t actually misuse it, really…) and with IntelliJ IDE assistance in finding the errors in my java syntax (I was removing ALOT of code and it kept breaking the java compile and assemble…) I crafted a POC that simply called an outside bash script to catch the dropped-on-the-floor notifyCommit and do something useful with it. Initially it called a bash script. Eventually most of the work was moved into the plugin and written in java.

I broke it back to a simpler version for the flexibility that allows. If you don’t like the exact process I assume in the script I call, write your own.

AOL (for whom the original plugin code was written) agreed to open-source the plugin and made some motions toward it, but as far as I can tell never released it. Oath didn’t even try to do so.

So, as a newly written work, initpipeline gets open-sourced. Under the original MIT license.

initPipeline_JenkinsPlugin.

 

— doug