FWIW, I have implemented a 2-tier build approach where the first job prepares 
the source code workspace, pulling from whatever SCM. The second tier is the 
builder. It takes, as one parameter, that is the $WORKSPACE of the tier 1 job, 
performs all the building, testing, scanning in THAT job’s workspace. At 
completion, the tier 1 job can now report all is own successes, build times, 
test results, etc

This model enables several things:


1.       One core builder common to lots of branches

2.       building from separate branches

3.       re-building past builds (the tier 1 job populates a workspace from a 
particular commit)

4.       tier 1 jobs that produces Release Candidates can run extra step like 
labeling the source, creating checksums, virus scanning the workspace, etc

5.       even build developer workspaces as long as the location is network 
accessible

From: [email protected] 
[mailto:[email protected]] On Behalf Of [email protected]
Sent: Saturday, August 13, 2016 10:24 AM
To: Jenkins Users
Subject: Re: Best practices: many distinct jobs vs parameterized jobs

I follow the principle of "one job per codebase (git repo)". The problem with 
reusing the same job across multiple codebases is that it makes any and every 
trend data invalid for the job in question. By trend data, I mean things such as

  *   Build success rates
  *   Average build times
  *   Test success rates
  *   Test coverage data
  *   Static analysis trends
  *   Artifacts sizes
  *   ... etc. etc.
The way to think about what should run under a single job should be influenced 
by what kind of grouping would ensure that the trend data is meaningful.

The one place where this gets ambiguous is dealing with branches and forks for 
a give code base. There are situations wherein it makes sense to consolidate 
build trends across branches and orks into a single job and there are 
situations wherein it is best to track them separately. The only way to track 
it separately in jenkins 1.x is to have one job for each. Jenkins 2.x has a 
mechanism wherein you have have a single job (pipeline) across the branches and 
yet, track their statistics separately.


On Saturday, August 13, 2016 at 2:23:15 AM UTC+5:30, Rich Schumacher wrote:

Hey folks,



I'm using the Job DSL plugin to create CI/CD pipelines for a bunch of projects. 
The projects themselves are very similar and therefore the jobs for build and 
release will be nearly identical, differing only in stuff like Git repo to 
clone, email address for notifications, etc. I've been going back and forth 
about using distinct jobs for each project or to use a parameterized job for 
each step of the pipeline. The former leads to a proliferation of jobs that are 
nearly identical. The latter leads to jobs that might have 3-6 parameters and 
means it's difficult to use directly since you'll need to define all the 
parameters. The nice thing is that the Job DSL plugin makes either case pretty 
easy to support.



So my question is really about best practices and preferences: many distinct 
jobs vs a handful of parameterized jobs? Are there any non-obvious pro/cons 
that I'm missing?



Thanks in advance!
--
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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1fd10095-47a2-4d3f-82fe-1b3f10cadd92%40googlegroups.com<https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_jenkinsci-2Dusers_1fd10095-2D47a2-2D4d3f-2D82fe-2D1b3f10cadd92-2540googlegroups.com-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=DQMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=U2-LNjgZVrBT7PM7hPh9BOm2Yoo4p5OiB7s6F9GVX6U&s=PDK7UyvOHdPbk0majN3aJCyi-qKrs4qqmDB3Pr_lRIU&e=>.
For more options, visit 
https://groups.google.com/d/optout<https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DQMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=U2-LNjgZVrBT7PM7hPh9BOm2Yoo4p5OiB7s6F9GVX6U&s=t9h4njycFkYklO-I5EfiMAyr6KvL86q8RvQ_i_DcRwg&e=>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D873D35D%40AMERMBX02.PERKINELMER.NET.
For more options, visit https://groups.google.com/d/optout.

Reply via email to