问题
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
回答1:
You can define an environment variable for your build configruation (i.e. env.RELEASE_VERSION)
Then click edit
and define the parameter specificaiton. Here you define how to select/enter the value for the environment variable
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
来源:https://stackoverflow.com/questions/31127030/teamcity-specifying-the-previous-build-version-as-build-step-parameter