Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Putting TeamCity build number into the assemblies it build

Tags:

teamcity

I am new to TeamCity and I have just installed it and set it up with subversion. I would like the TeamCity build number to be put in the output files, so that my Application.exe has the same build number.

How can I do this?

like image 961
kasperhj Avatar asked Jul 12 '11 12:07

kasperhj


People also ask

How do I change my TeamCity build number?

Go to the General Settings of the build configuration. Click the orange Show advanced options. Set the Build counter to your desired value. Set the Build number format to %build.

How do I add builds to TeamCity?

Go to Administration | Projects and open the required project. Alternatively, open the project using the Projects pop-up menu and click Edit Project Settings. The Project Settings page will open. On the Project Settings page, click Create build configuration under the Build Configurations section.

What is build ID in TeamCity?

teamcity.buildType.id. none. The unique ID used by TeamCity to reference the build configuration the current build belongs to. teamcity.configuration.properties.file.

How do I check my TeamCity build history?

This page can be accessed from the Build Configuration Home page and from various places in the TeamCity UI where a build number or build status appears as a link, when browsing in the Home mode.


3 Answers

There is now an assemblyinfo patcher built into teamcity. They call it a build feature: http://confluence.jetbrains.net/display/TCD65/AssemblyInfo+Patcher

Use that with the parameters mention or make your own e.g.: 1.2.%build.vcs.number%.1

like image 191
James Woolfenden Avatar answered Oct 17 '22 01:10

James Woolfenden


try this:

  • Team City - Update AssemblyInfo with current build number

This is using Team City with MSBuild. If you're using Nant try this:

  • Getting the TeamCity build number into the AssemblyInfo file using Nant
like image 39
Colin Pickard Avatar answered Oct 16 '22 23:10

Colin Pickard


I run a powershell script after getting the sources from svn and before the build starts.

More or less like so.

http://jake.murzy.com/post/3099699807/how-to-update-assembly-version-numbers-with-teamcity

like image 1
Loofer Avatar answered Oct 17 '22 01:10

Loofer