jenkins - Javascript to enhance parameterized builds - Stack Overflow

The 'parameterized' builds in Jenkins are a bit limited. What if I want to have options that

The 'parameterized' builds in Jenkins are a bit limited. What if I want to have options that are related to one another?

For example 2 drop down lists. The selection from the first one controls the options in the second...

I don't really see any prescribed way to implement this, but a thought (and it feels super-hacky) would be to use javascript.

I've noticed you can enter <script> tags in the description attribute of parameters. Maybe a place to drop in some js? Also looks like prototype.js ships with the system.

So just how bad an idea is that, or is there a 'correct' way to do such a thing?

The 'parameterized' builds in Jenkins are a bit limited. What if I want to have options that are related to one another?

For example 2 drop down lists. The selection from the first one controls the options in the second...

I don't really see any prescribed way to implement this, but a thought (and it feels super-hacky) would be to use javascript.

I've noticed you can enter <script> tags in the description attribute of parameters. Maybe a place to drop in some js? Also looks like prototype.js ships with the system.

So just how bad an idea is that, or is there a 'correct' way to do such a thing?

Share Improve this question asked Dec 6, 2013 at 23:01 quickshiftinquickshiftin 69.9k11 gold badges72 silver badges98 bronze badges 1
  • I posted the question on the Google group for Jenkins dev. Sounds like there really isn't anything out there for this, but another person said an interface to configure parameter relationships would be nice. – quickshiftin Commented Dec 11, 2013 at 16:29
Add a ment  | 

2 Answers 2

Reset to default 3

Check out the Active Choices Plugin it does exactly what you're looking for:

jenkins-ci - Active Choices Plugin
github. - Active Choices Plugin

A Jenkins UI plugin for generating and rendering multiple value options for a job parameter. The parameter options can be dynamically generated from a Groovy script and can respond to changes in other job parameters. The value options can be rendered as bo-boxes, check-boxes, radio-buttons or rich HTML. Active Choices strives to provide in a single plugin functionality found scattered among several pre-existing plugins and some unique capabilities that are not available yet.

The Active Choices plug-in provides additional Jenkins parameter types that can be rendered as user interface (UI) controls in job forms.

Once the plugin is installed three new parameter types bee available:

  • Active Choices Parameter
  • Active Choices Reactive Parameter
  • Active Choices Reactive Reference Parameter

Active Choices parameters allow users to select value(s) for a job parameter. Parameter values can be:

  • dynamically generated (using Groovy or a Scriptler script)
  • dynamically updated based on other UI parameters
  • multi-valued (can have more than one value)
  • rendered with a variety of UI controls, including dynamic HTML

I think you would be able to acplish your listed example with the following dynamic parameters plugin without using javascript: https://github./tekante/Dynamic-Jenkins-Parameter/wiki. I have not personally used the plugin as a disclaimer. It looks like it will probably need to be built first based on what I have seen in the GitHub repo and the fact that I cannot find it on the official Jenkins plugin page.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745672266a4639476.html

相关推荐

  • jenkins - Javascript to enhance parameterized builds - Stack Overflow

    The 'parameterized' builds in Jenkins are a bit limited. What if I want to have options that

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信