Jenkins Build Name Setter Plugin does not find variable

末鹿安然 提交于 2019-12-23 20:44:49

问题


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?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/30071462/jenkins-build-name-setter-plugin-does-not-find-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!