本文介绍了TeamCity - 使用 setParameter 在构建步骤之间传递信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须做一些不同于这里询问和回答的事情,因为该解决方案似乎对我不起作用:TeamCity,将一个构建步骤中生成的 id 传递给后面的构建步骤

I must be doing something differently than what was asked and answered here because the solution does not appear to be working for me: TeamCity, passing an id generated in one build step to a later build step

我想在最终构建步骤中使用由一个构建步骤生成的字符串.到目前为止,我已经设置了一个名为TEST"的环境变量,它是空的.两个构建步骤都使用命令行运行程序.

I want use a string generated by one build step in a final build step. So far I have set up an environmental variable called "TEST" that is empty. Both build steps use the Command Line Runner.

构建步骤 #1:

\##teamcity[setParameter name='env.TEST' value='test']

构建步骤 #2:

echo $TEST

echo %env.TEST%;

现在占位符,但如果我可以访问在构建步骤 1 中设置的测试字符串 ('test'),我会很高兴.

Placeholder for now, but if I could access the test string ('test') set in Build Step 1 I would be so happy.

推荐答案

你需要回显那个字符串,例如

you need to echo that string, e.g.

echo "##teamcity[setParameter name='env.TEST' value='test']"

这篇关于TeamCity - 使用 setParameter 在构建步骤之间传递信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 23:38