Jenkins Build Name Setter插件找不到变量

Jenkins Build Name Setter插件找不到变量

问题描述:

在Jenkins中,我使用参数化的构建.我将名称"设置为SVN_TAG,使用了此构建已参数化"和列出子版本标签".然后,在设置内部名称"中将此SVN_TAG设置为"$ {SVN_TAG}".但是,该版本然后显示'$ {SVN_TAG}中的无法识别的宏'SVN_TAG'"",并且它没有设置版本名称.为什么构建找不到该宏的任何想法?

In Jenkins I use a parameterized build. I use the "This build is parameterized" and "List subversion tags" to which I set the "Name" to be SVN_TAG. Then I set this SVN_TAG in "Set Build Name" to "${SVN_TAG}". However, the build then says "Unrecognized macro 'SVN_TAG' in '${SVN_TAG}'" and it does not set the build name. Any ideas to why the build doesn't find this macro?

如果单击构建名称"字段旁边的(?)帮助图标,您将看到可以使用的宏的列表.

If you click on the (?) help icon next to the Build Name field, you'll see a list of the macros you can use.

在构建过程中,构建参数将作为环境变量导出,因此根据该文档,您需要使用格式${ENV,var="VARIABLENAME"}.

Build parameters are exported as environment variables during the build, so as per that documentation, you need to use the format ${ENV,var="VARIABLENAME"}.

因此,使用值${ENV, var="SVN_TAG"}应该会为您提供所需的行为.

So using the value ${ENV, var="SVN_TAG"} should give you the behaviour you're looking for.