詹金斯全局变量 [英] Jenkins global variables

查看:85
本文介绍了詹金斯全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows的Jenkins中使用全局变量来自动"从我们的SCM系统中检索适当的代码库,但是在每种情况下,我都没有尝试过变量替换.

I'm trying to use global variables within Jenkins on Windows to "automagically" retrieve the proper code base from our SCM system, but in each case that I've tried the variable substitution is not happening.

我已经在配置系统"中设置了一些具有默认值的全局变量,并尝试使用$VARIABLE${VARIABLE}%VARIABLE%来访问它们,作为Surround SCM插件的Branch字段的一部分.没有任何成功.

I've set up some global variables, with default values, within "Configure System" and have tried to access them with $VARIABLE, ${VARIABLE} and %VARIABLE% as part of the Branch field for the Surround SCM plugin with no success whatsoever.

我还安装了具有相同成功率(0%)的Global Variable String Parameter插件.使用文字值可以很好地工作,但是似乎根本没有任何类型的变量替换可以使用,并且我敢肯定有人曾经遇到过并解决了这个问题.

I've also installed the Global Variable String Parameter plugin with the same success rate (0%). Using a literal value works just fine, but no type of variable substitution seems to work at all and I'm sure that someone has come upon this before and resolved it.

我曾尝试搜索与此类似的东西,但没有什么方法能真正使用这种全局变量,而是通常将其作为外部脚本中的函数或传递给批处理文件的参数等进行讨论.

I've tried searching for something similar to this but nothing really approaches this usage of globals, instead it is normally discussed as a function within an external script, or parameter passed to a batch file, etc.

我已经将"set"作为第一步,可以看到该变量可用,但是替换没有发生.如果这意味着我将不得不编写一些脚本,那么就顺其自然,因为我正在尝试使其变得极为灵活且尽可能避免头痛,但是到目前为止,在这种情况下似乎并非如此.

I've run "set" as the first step and can see that the variable is available, but the substitution is just not happening. If it means I will have to script something, then so be it, as I am trying to make this extremely flexible and as headache free as possible, but that isn't seeming to be the case in this case thus far.

我的问题与这篇帖子非常相似:

My problem is eerily similar to this post: How are environment variables used in Jenkins with Windows Batch Command?, but again, I'm not looking to script this as it is a MUCH simpler solution to use the variable values directly.

推荐答案

来自 https://wiki.jenkins-ci.org/display/JENKINS/Surround+SCM+Plugin

故障排除

如果对集成或集成有疑问,请联系Seapine支持. 报告错误或功能请求.

Please contact Seapine support with questions about the integration or to report bugs or feature requests.

这篇关于詹金斯全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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