Load build numbers from file in VCS
Is it possible to get a build number format based on the content of a file in the VCS?
The problem is that the build number in TeamCity does not automatically match the compiled version of the software, which is defined in a file, without manually updating both whenever we bump the software version in that file, for example "/branches/3.2 Stable/version.txt" in this case.
Our current format for a build configuration based on a template looks like below. We branch out and derive a new build configuration from the template each time we bump the major/minor version.
Build number format: %majorversion%.%minorversion%.{0}.%build.vcs.number%, next build number: #%majorversion%.%minorversion%.7.%build.vcs.number%
The parameters are defined per build configuration as:
Build Parameters
Configuration parameters:
Name Value
buildconfiguration Release
majorversion 3
minorversion 2
vcspath branches/3.2 Stable
Obviously, two of the version parameters are hard coded here (3.2.xx.xx) and I need them to be determined by reading from that file somehow. Is this possible or is there another way of accomplishing the same thing?
Thanks!
Please sign in to leave a comment.
Yes, you can Report Build Number right from your build script using service messages.
Michael