基于先前字符串参数的动态参数 [英] Dynamic parameter based on previous string parameter

查看:49
本文介绍了基于先前字符串参数的动态参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Jenkins中,我有一个字符串参数 HOST .在此参数之后,我有一个动态参数 URL .此参数必须是字符串的串联,包括先前定义的 HOST 参数.

我一直不知道该怎么做.

这样做的动机是后续参数也将使用此 HOST 参数.

解决方案

请确保我正确理解您的要求:您有两个参数,后一个取决于第一个参数的值?

如果是这样,我认为

  • 以指定的值构建:

  • 构建结果:

  • 如果在构建时更改 HOST 的值,则 URL 也会更改.

希望这会有所帮助:-)

In Jenkins I have a string parameter HOST. After this parameter I have a dynamic parameter URL. This parameter needs to be a concatenation of strings, including the previously defined HOST parameter.

I have been unable to find out how to do this.

The motivation for this is subsequent parameters will also use this HOST parameter.

解决方案

Just make sure I understand your requirement correctly: you have two parameters and the later one is depends on the value of the first one?

If it's so I think plugin Parameterized Build is enough for this:

  • Job configuration:

  • Build with specified value:

  • Build result:

  • If you change your HOST value at build, the URL will also changed.

Hope this helps :-)

这篇关于基于先前字符串参数的动态参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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