jenkins-job-builder

George Shuklin
Aug 24, 2017 · 2 min read

Every improvement which moves your infrastructure from knobs to git is a step in the right direction.

Jenkins is a great tool… No, I can’t say this. I don’t like it. But it’s the single working tool for serious CI, so it doesn’t matter if I like it or not.

One problem with Jenkins is that it’s too visual. Been visual and been manageable through browser interface is amazing for newcomers. It’s not easy, it’s not convenient, but it helps with discoverability of features. So you can at least guess and try turn different knobs until you get result. Self-learning 100%.

Knobs are evil

Every time someone made complicated stuff to work in Jenkins by turning many knobs into right position, new artifact bears. Now position of those knobs is sacred, and it’s ‘someone’ job result. Loosing knobs position means that ‘someone’ need to repeat his/her work. May be s/he will do it in 30 minutes instead of previous 4 hours, but it’s still 30 minutes of error-prone work with barely transferable expertise. I saw jobs which worked by magic unknown to their creator. With sheer luck, or persistence and you made it work without understanding ‘how’. Sad, but true.

Those artifacts must be preserved. That means: backups. And if you have some big department split, you need to transfer those jobs into other servers… And there are dependencies on jenkins modules, golden slaves and all other ops horrors of well-matured enterprise.

git is gud

If you have a way to save your Jenkins jobs as files into repository, you suddenly reduce golden artifacts to the golden commits. Which is much, much better. Commits are persistent, stored on many machines. Files in commit are manageable, movable, refactorable. Reuse of those files is repeatable, and often is fast. Moreover, as soon as you have those files with jobs world of templatization and further automation is open to you.

Jenkins-job-builder

I’ve just learned and wrote my second yaml file for the jenkins-job-builder. This application allows to write Jenkins jobs with yaml files and load them into Jenkins.

The process was simple and short, it took me about 40 minutes. Next job of same type will take me 1 minute to complete, and I already see automation light, as those jobs look very similar to each other (package rebuild and upload into local apt repo). I’ll wait for few more jobs before automating them just to see a pattern better.

It wasn’t a big deal, such improvements happens all the time at my job.

But I want to preserve this feeling of transforming knobs into git files, as this is a proper thing to do, and it brings quietness and assurance into my job.

)

Written by

I work at Servers.com, most of my stories are about Ansible, Ceph, Python, Openstack and Linux.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade