在构建功能teamcity中使用用户定义的参数时出现问题?
我有一个包含两个构建步骤的模板:在构建功能teamcity中使用用户定义的参数时出现问题?,teamcity,Teamcity,我有一个包含两个构建步骤的模板: 马文 命令行 命令行步骤在我希望在构建功能中使用的变量中设置当前日期时间 我通过命令行步骤获得正确的当前日期时间,如下所示: #!/bin/bash export current_build_date_format="+%%d%%m%%Y_%%H%%M%%S" export current_build_date="$(date $current_build_date_format)" ##teamcity[setParameter name='current_b
#!/bin/bash
export current_build_date_format="+%%d%%m%%Y_%%H%%M%%S"
export current_build_date="$(date $current_build_date_format)"
##teamcity[setParameter name='current_build_date' value='$current_build_date']
当我试图在构建功能中引用它时,它无法通过“%current\u Build\u date%”识别参数
在配置参数部分
少了什么?我已经通过命令行定义了该参数,teamcity功能将如何使用该参数
参数错误:
首先读取用户定义的参数时出错:
Initialization
[05:42:27][Initialization] - Build Details Validator
[05:42:27][ Build Details Validator] Error: Conversion = 'm'
[05:42:27][Initialization] Build validation failed
您需要回显TeamCity服务消息,以便TeamCity解析并使用它,例如:
echo "##teamcity[setParameter name='current_build_date' value='$current_build_date']"
当我回显并尝试在buildFeature中使用时,它在代理兼容性方面失败1。那么,“echo”设置参数是否正确?2.实际上,我们在谈论什么构建特性?3.它是如何在代理兼容性方面失败的?我正在使用构建参数功能设置构建版本。一旦我使用了上面设置为%current\u build\u date%的参数,就无法解析。如果我不使用内置功能,我会在构建参数中看到。获取屏幕截图中的错误如果我没有弄错,问题是您试图在不定义参数的情况下使用参数:您在构建运行时设置了参数,但TeamCity不知道您是这样做的。您可以在配置参数
部分中编辑
参数并添加一些值-它将在构建期间被setParameter的实际值替换。您的想法是正确的,让我试试您的建议。