Hi,
Am looking at having different build numbering schemes - one for timer triggered and another for builds triggered via git events.
As of now, I cannot install any new plugin as that might force us to upgrade Jenkins -- ours is quite older version and the upgrade is long overdue.
However, am exploring the possibility of having this customization handle via Groovy code.
So, what's the need for different build numbering scheme?
a) Codebase (repo hosted in github enterprise) receives commits on 'master' -- this should generate artefacts. However, timer triggered build should not for this codebase.
b) We are running Jenkins v2.x Pipeline with multi-branch setup and shared library. So, essentially, 'master' branch shares the Groovy library with another 'dev' branch in the same code repo. This Groovy library (in scripted pipeline) triggers the build for both the branches at the specified time, does a branch check; if the branch is 'dev' proceed further, but will stop if the branch is 'master'. However, in the latter case, build number gets incremented and that's not the desired behavior (per project requirements).
c) Jenkinsfile in the codebase sets a bunch of params with default values using Groovy closure. This is picked by the Groovy library (i.e. vars/buildCodeArtefacts.groovy)
buildCodeArtefacts{
param1 = "value1"
VERSION = "0.2"
}
Are there better ways to handle this than the idea of different build numbering scheme?
/Ram