Teamcity,为下一次构建设置配置参数 [英] Teamcity, set configuration parameter for next build

查看:36
本文介绍了Teamcity,为下一次构建设置配置参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置/更改构建 1 中的构建参数以用于构建 2.

I'm trying to set/change a build parameter from build 1 to be used in build 2.

在构建 1 中,我有一个构建步骤,可以设置如下配置参数:

In build 1 I have a build step that sets a configuration parameter like this:

echo "##teamcity[setParameter name='ENVIRONMENT' value='%Target environment%']"

在构建 2 的构建步骤中,我想通过以下方式在 rake 任务中使用此环境变量指定 %ENVIRONMENT%

And in a build step on build 2, I want to use this environment variable in a rake task by specifying %ENVIRONMENT%

我遇到的问题是配置参数在构建 2 中不可见.我肯定错过了一些重要的东西.

The problem I have is that the configuration parameter is not visible in build 2. I have surely missed something essential.

我也尝试过使用 env 变量,但这似乎是错误的方法,因为这只是构建脚本中不需要的配置变量.

I have also tried with env variables but that seems like the wrong approach as this is just configuration variables which is not needed in a build script.

有什么线索吗?

谢谢

推荐答案

可以在 build 1 中发布一个带有你想要的值的工件,在 build 2 的第一步中引入一个 artifact 依赖从 build 2 到 build 1使用您提到的 echo(或更好的 Write-Host)语句,将该工件再次转换为构建 2 中其他步骤的配置值.

You can publish an artifact with the value you want in build 1, introduce an artifact dependency from build 2 to build 1, and in the first step of build 2 transform that artifact into a configuration value again for the other steps in build 2 by using the echo (or better Write-Host) statement you mentioned.

这篇关于Teamcity,为下一次构建设置配置参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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