TeamCity - Specifying the previous build version as build step parameter

…衆ロ難τιáo~ 提交于 2020-01-06 03:35:27

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!