3lysium
3lysium

Reputation: 123

TeamCity - Specifying the previous build version as build step parameter

I have a project in TeamCity where one of the build steps calls an exe with parameters consisting of currentReleaseId/PreviousReleaseID.

Current release is simple enough because I can just use %build.counter% built into TC. Does anyone know how can I get the %build.counter% - 1 id to pass as the second param?

Current setup:

TeamCity Build Step Run: Executable with parameters

Command executable: \CIS\E$\PerformanceTracker\ConsoleApp\PerformanceTracker.ConsoleApp.exe

Command parameters: %build.counter% r1.0.45

Upvotes: 1

Views: 1388

Answers (1)

rufer7
rufer7

Reputation: 4119

You can define an environment variable for your build configruation (i.e. env.RELEASE_VERSION)

Define environment variable

Then click edit and define the parameter specificaiton. Here you define how to select/enter the value for the environment variable

Edit parameter specification

After defining the variable it could be referenced in the build configuration in the same manner as %build.counter% (i.e. %env.RELEASE_VERSION%). If you then start the build you will be prompted to enter the value for the release version parameter

Upvotes: 2

Related Questions