【问题标题】:How do i set a parameter in one step that i can use in another如何在一个步骤中设置一个可以在另一个步骤中使用的参数
【发布时间】:2015-01-10 20:19:06
【问题描述】:

我想在构建配置的一个步骤中设置一些描述的变量,我可以在另一个步骤中使用。

所以在第 1 步中我设置了变量,在第 2 步中我读取了变量

这可能吗?

【问题讨论】:

    标签: teamcity


    【解决方案1】:

    要做到这一点在相同的构建配置中,您需要使用service messages

    要在同一项目内共享构建配置,您可以通过项目参数来实现。目前从 TeamCity 8.1 开始,要在构建中设置它,您需要添加一个步骤来运行 curl.exe 实用程序并通过 TeamCity REST API 设置参数值。

    C:\Path\To\curl.exe -v --request PUT -d "YourParamValue" --Header "Content-Type: text/plain" http://YourUser:YourPassword@YourTeamcity.server.local:port/httpAuth/app/rest/projects/YourProjectName/parameters/YourParameter
    

    相关:Teamcity, set configuration parameter for next build

    TeamCity, passing an id generated in one build step to a later build step

    【讨论】:

    • 是的,服务信息正是我所寻找的。 "##teamcity[setParameter name='foo' value='bar']" 成功了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多