I went back and forth on this. In the end, I put everything in code. I 
decided I wanted the minimum amount of stuff configured in jenkins. 

I started out with a wrapper pipeline that loaded the "guts" of the job. 
This was extremely restrictive in that each job had to conform at some 
level to the expectations of the wrapper. I switched to a library of code 
and all of my common parameters are stored in the library. I found that 
this was also easier to debug as I could create a jenkins job that loaded 
the library and ran the unit tests that I defined inside it. 

This is all using multi-branch pipelines, BTW, and my devops code is in the 
same repo as the product code, so it all gets branched at the same time. 
This gives me more confidence that I can reproduce any build later, no 
matter how much my devops code changes. If you store this library in a 
different repo, then make sure you have some way to select the correct 
version or else you will have trouble reproducing old builds (I often have 
7 or more branches in development so this is important to me). 


On Wednesday, April 15, 2020 at 11:49:48 AM UTC-4, marouane zhani wrote:
>
> Hi everybody,
>
> Since a lot of my jobs have more or less the same set of parameters, I 
> wanted to implement a "parent job" where we have the shared configuration, 
> and all "children" jobs should just inherit from the "parent" and change 
> the parameters if needed.
>
> I have found that the "inheritance job plugin",which is fitting more or 
> less my needs. However, I am still having the following problems with it: 
>
>
>    -  How to get the parameters of the parent job (as environment 
>    variables for example) and use them in the build steps of the child job. 
>    -  Is it possible to have the same structure with pipelines or 
>    multi-job? I mean here if it's possible to have just one parent multi-job 
>    where we have the common configuration, and then all the other multi-jobs 
>    should use the parent one as a reference. 
>
>
> Looking forward to your help.
>
> Thank you in advance,
>
> Marouane ZHANI
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fd6ff22e-4fcd-4f1f-8a68-7b1a39c8c496%40googlegroups.com.

Reply via email to