Teamcity,为下一次构建设置配置参数

编程入门 行业动态 更新时间:2024-10-25 01:28:00
本文介绍了Teamcity,为下一次构建设置配置参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试设置/更改构建 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屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 07:31:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1405875.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   Teamcity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!