Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In TeamCity, is there a system/environment variable for the current build configuration id?

Tags:

teamcity

In TeamCity, if you know the build configuration id, then you can generate URLs like this:

http://example.org/guestAuth/repository/download/bt222/.lastSuccessful/exampleBuild.zip

But see that "bt222"? That's the Build Configuration ID; it is generated by TC when you set up the build configuration, and it's static. The Atlassian docs seem to say that the way to determine it is to look at your URL, on screen.

Thing is, I need to get at it programmatically, in the msbuild script, so that the same build script can serve multiple build configurations. TC otherwise has so many nice handy variables that I'm just hoping I've missed it somehow...

like image 435
John Hatton Avatar asked Mar 08 '13 01:03

John Hatton


People also ask

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.

What is a build configuration in TeamCity?

This section contains articles on how to create and configure build configurations via the TeamCity UI. A build configuration is a collection of settings used to start a build and group the sequence of the builds in the UI.


2 Answers

The configuration ID is available as %system.teamcity.buildType.id%.

Verified to work in Teamcity 7.1.5

like image 137
knatten Avatar answered Oct 19 '22 04:10

knatten


Make it as parameter to your build script and set it in build configuration settings from outside.

Build script should not depend on the build server, it should work locally as well.

like image 22
Aleš Roubíček Avatar answered Oct 19 '22 04:10

Aleš Roubíček