【问题标题】:Service message in TeamCity not workTeamCity 中的服务消息不起作用
【发布时间】:2016-06-03 06:44:16
【问题描述】:

命令行

echo ##teamcity[setParameter name='test' value='0.%build.number%']
echo %test%

日志

[Step 1/1] ##teamcity[setParameter name='test' value='0.10']
[Step 1/1] 0

怎么了?

【问题讨论】:

    标签: service command-line message teamcity-9.1


    【解决方案1】:

    所有参数引用在执行脚本之前解析,所以如果test在将脚本写入文件之前值为0,则脚本内容为

    echo ##teamcity[setParameter name='test' value='0.10']
    echo 0
    

    正确的解决方案是将0.%build.number% 存储在某个变量中并使用它,例如

    _test="0.%build.number%"
    echo "##teamcity[setParameter name='test' value='0.$_test']"
    echo $_test
    

    【讨论】:

      猜你喜欢
      • 2019-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-21
      • 2017-02-09
      • 2021-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多