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 which goes as follows > > > String IncBuildNum() { > > def v= getVersion("path/to/file.xml") > > def splitted= v..split('\\.') > splitted[3]= (((splitted[3] +1 as BigDecimal) + 1 ) as String) > > return splitted.join('.') > } > > However, I will like to increase this number 1 for every Jenkins build. > Right now > Is this possible? > -- 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/b97bdd9d-5238-4db3-abc4-2ef4bd984e36%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.