Jenkins Build Name Setter插件找不到变量 [英] Jenkins Build Name Setter Plugin does not find variable

查看:371
本文介绍了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.

这篇关于Jenkins Build Name Setter插件找不到变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆