[英]Jenkins Declarative Pipeline: How to call functions from "Active choices reactive reference parameter's Groovy script"?
I am trying to build a pipeline that can,我正在尝试建立一个可以,
My approach:我的做法:
Problem:问题:
Any help/guidance would be highly appreciated.任何帮助/指导将不胜感激。
In order to create a text area based on the Active Choices Parameter
, you have to do like this:为了创建基于
Active Choices Parameter
的文本区域,您必须这样做:
Sample code:示例代码:
if (data_center.contains('DC01')){
return """<textarea name="value" rows="5" class="setting-input">
</textarea>"""
} else
if (data_center.contains('DC02')){
return """<textarea name="value" rows="5" class="setting-input">
</textarea>"""
}
You need to select Choice Type
as Formatted HTML
您需要选择
Choice Type
作为Formatted HTML
For more details, please refer this post:更多详情,请参考这个帖子:
Jenkins generate new parameters based on another parameter value Jenkins 根据另一个参数值生成新参数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.