How to set buildNumberPattern with short vcs number?
I'm trying to set a custom buildNumberPattern like this
buildNumberPattern = "1.0.%build.counter%.${"%build.vcs.number%".take(7)}"
I've tried it in mutliple ways but I always get 1.0.###.%build.
Is there a correct way to set this? Or isn't it possible?
Please sign in to leave a comment.
Hi Shauli,
In TeamCity, the buildNumberPattern does not support direct string manipulation functions like .take(7).
However, you can achieve the desired result by using ##teamcity[buildNumber '<new build number>'] service message way to override the build number dynamically during the build. Use a Command Line or PowerShell step:
Linux/macOS (Bash)
Windows (PowerShell)
Best Regards,
Tom