Re: How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Faad Sayaou
The build number gets really large which is something we do not want. Would have been good if there was a way to reset it. On Thursday, 24 January 2019 21:01:39 UTC+1, Justin Harringa wrote: > > Any reason you couldn't use the BUILD_NUMBER environment variable for this? > > On Thursday, January

Re: How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Justin Harringa
You can change nextBuildNumber but there are some implications there. Sounds like you're not only looking for an incrementer but a semantic version handler. You do get new build numbers with multi-branch. I could see something like that working by using a branching strategy for each semantic major.

Re: How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Justin Harringa
Any reason you couldn't use the BUILD_NUMBER environment variable for this? On Thursday, January 24, 2019 at 10:12:30 AM UTC-8, Faad Sayaou wrote: > > Hello everyone, > > I would like to auto increment a number for every Jenkins build. I have a > function which reads value (1.0.0.0) from a file

How to auto increment a variable for every Jenkins Build

2019-01-24 Thread Faad Sayaou
Hello everyone, I would like to auto increment a number for every Jenkins build. I have a function which reads value (1.0.0.0) from a file which goes as follows String IncBuildNum() { def v= getVersion("path/to/file.xml") def splitted= v..split('\\.') splitted[3]= (((splitted[3] +1 as BigDe