TeamCity-将先前的构建版本指定为构建步骤参数 [英] TeamCity - Specifying the previous build version as build step parameter

查看:162
本文介绍了TeamCity-将先前的构建版本指定为构建步骤参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在TeamCity中有一个项目,其中一个构建步骤使用包含currentReleaseId/PreviousReleaseID的参数调用一个exe.

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

当前版本非常简单,因为我只能使用内置在TC中的%build.counter%.有谁知道我如何获取%build.counter%-1个ID作为第二个参数传递?

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?

当前设置:

TeamCity建立步骤 运行:可通过参数执行

TeamCity Build Step Run: Executable with parameters

命令可执行文件: \ CIS \ E $ \ PerformanceTracker \ ConsoleApp \ PerformanceTracker.ConsoleApp.exe

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

命令参数:%build.counter%r1.0.45

Command parameters: %build.counter% r1.0.45

推荐答案

您可以为构建配置定义环境变量(即env.RELEASE_VERSION)

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

然后单击edit并定义参数规格.在这里,您定义如何选择/输入环境变量的值

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

定义变量后,可以在构建配置中以与%build.counter%(即%env.RELEASE_VERSION%)相同的方式对其进行引用.如果然后开始构建,将提示您输入发布版本参数的值

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

这篇关于TeamCity-将先前的构建版本指定为构建步骤参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆