Setting build number format externally

We currently have the build number format set to 1.0.{0} which is then used in a staging configuration that publishes the project artifacts to a folder using that structure. Recently the devs wanted to bump the number up to 1.1.{0}. Without making them project admins I had to go in and do this myself, which isn't the most optimal way to do this (and I didn't want to give everyone admin access to the server to do it themselves).

Is there any way to have NAnt set this back into the project so it could be driven by the project build file rather than TeamCity?

Comment actions Permalink

@Eugene: One question, we've done this and it works great (thanks!). However later in the build file we use ${build.number} to distribute files to a directory structure that needs the full version number (e.g. files\dist\projectName\0.0.1). After setting the build number in NAnt when I use ${build.number} it comes back as the original format from TeamCity rather than the new one?

Does TeamCity not update the variable immediately? That's okay as I can just set a fully qualified property for use later in the script. I just thought by setting it via the ## directive, asking for it again would get the newly formatted value.


Comment actions Permalink

Yes. Unfortunatly TeamCity will not change the value of ${build.number} after changing it using service message.
The idea here was that if you change build number explicitly, you will change any related NAnt property as well.


Comment actions Permalink

Boa tarde!

Gostaria de saber como é possível configurar o Build number format no team city?

Configurar de modo que pegue sempre o número da build anterior e a partir do anterior faça a contagem. Exemplo:

Build: Release: (essa é a build anterior)

Build: Hotfix:–1 (pega a númeração anterior e faz uma revisão encima)


Como configuro Build number format: ?


Please sign in to leave a comment.