1

Using Jenkins, I'd like to set the version number of a c# assembly to something like 1.0.${SVN_REVISION}.${BUILD_NUMBER}. Unfortunately the Change Assembly Version plugin doesn't see the SVN revision number. Does anyone know a way to get this working?

Andy P
  • 11
  • 2

1 Answers1

3

I suspect that you have multiple SVN modules in use since I'm unable to reproduce your problem with Jenkins 1.651.1 and Change Assembly Version plugin 1.5.1.

The environment variable SVN_REVISION is replaced with multiple variables (SVN_REVISION_1, SVN_REVISION_2, ...) if you have more than one subversion module configured to your job. This would lead to undefined variable that cannot be expanded properly.

OltzU
  • 666
  • 7
  • 4
  • I'm afraid that doesn't help. There is only one subversion module, and SVN_REVISION_x are not defined. I added a step to the build to list the environment variables, the are no variables starting with SVN. I am using Jenkins 2.1 with Change Assembly Version 1.5.1 – Andy P May 12 '16 at 14:11
  • I'm sorry but I'm unable to reproduce your issue with Jenkins 2.3 and Change Assembly 1.5.1. I'm actually seeing both SVN_REVISION and SVN_REVISION_1 when I have one Subversion module being checked out. If you are completely unable to see any SVN_* environment variables, that sounds even bigger problem for which I don't have any other idea than making absolutely sure you are actually checking out your source code in the job using Subversion. – OltzU May 13 '16 at 08:24