2 ms·
As Jenkins CI was gaining popularity, before they added native support for templating (which I think they have now. At least in their enterprise solution?)and a
by xahrepap 4y ago
As Jenkins CI was gaining popularity, before they added native support for templating (which I think they have now. At least in their enterprise solution?)and a few other things. I hacked a plug-in together that implemented templates. You’d configure the “template job” like any normal job, except you’d use a variable syntax ($whatever or similar) for any values you wanted the template to use. Then you could create new jobs with only one step “implement template” which had some prompts for the variables used in the template job.
It would rewrite the implementation jobs whenever you saved either the template or the implementation. It wasn’t super fancy or even that difficult to be honest. Just would copy the xml and do a text replace then force Jenkins to reload it.
It was a pretty inelegant and somewhat fragile solution. But it worked for what I needed. It even was the top google result for “Jenkins templates” for a while. I eventually had someone else start contributing bug fixes and I made them the maintainer.