Changing build version via service message not reflected in status UI

I'm trying to set up automated versioning with per-branch numbers. Any commits triggered by git (as opposed to manual builds kicked off by users without any code changes) should run some logic that uses the current parameter settings to increment the minor and/or patch version pertinent to the branch. I have all the logic worked out and coded in the first build step. It changes the necessary values, using service messages, to the correct numbers in the build output. The final step uses the API to persist the new values in the configuration so that they're still set for subsequent builds. The only thing that I can't seem to get right is the label on the build overview page. Since it's configured in the General Settings page, it seems to be processed and drawn to the UI before the first build step runs. So even though all my final parameters are set correctly and the artifacts are properly stamped, the UI label still shows the previous build number. This would be confusing to the devs, particularly when trying to track down the source of a deployment. Is there any way I can update the version numbers prior to the first build step? I'm looking for something akin to an onBuildStart kind of event that I can hook into, unless there's an easier way that I'm just not seeing.

 

0
1 comment
Avatar
Permanently deleted user

Hello,


Could you please give more details how you set build number in first step? Does it comply with TeamCity documentation? What API command do you use to persist the new values in the configuration? 


The label on the build overview page (the "1.0.16.34" one) is exactly that build number,which you set up via service message ##teamcity[buildNumber '<new build number>']


Please also clarify which parameter you specify in artifact name.

0

Please sign in to leave a comment.