Multibranch Project Parameterized Drop-down?

18 views
Skip to first unread message

pisymbol

unread,
Feb 8, 2018, 3:02:16 PM2/8/18
to Jenkins Users
How do I add build parameters to a multibranch project that is a drop down menu?

I can't find an example anyway and I know there has to be a way to do this! :-)

I was hoping some kind soul can give a DSL and/or Groovy script syntax example.

Thanks!

-aps

pisymbol

unread,
Feb 8, 2018, 5:42:13 PM2/8/18
to Jenkins Users
Well, I found the Groovy script to do it:

properties([[$class: 'ParametersDefinitionProperty', parameterDefinitions:
    [[$class: 'ChoiceParameterDefinition', choices: 'centos\nredhat\nmylittlepony\nheman', description: 'Please choose a platform', name: 'PLATFORM'],
    [$class: 'StringParameterDefinition', description: 'Custom configure options', name: 'CONFIGURE_OPTS']]]])

etc.

Is there a simple DSL statement that encapsulates the above? Man, the Jenkins doc is "challenging" to say the least.

-aps

Victor Martinez

unread,
Feb 9, 2018, 8:53:16 AM2/9/18
to Jenkins Users
Although I'm not aware of any dsl for that parameters, but the below URL might help you to convert UI configuration to pipelines easily:


Cheers

pisymbol .

unread,
Feb 9, 2018, 9:23:29 AM2/9/18
to jenkins...@googlegroups.com
On Fri, Feb 9, 2018 at 8:53 AM, Victor Martinez <victormar...@gmail.com> wrote:
Although I'm not aware of any dsl for that parameters, but the below URL might help you to convert UI configuration to pipelines easily:



Thank you! I do try the Snippet Generator all the time though. The problem is the generator is very incomplete, e.g. "parameters" etc.

-aps 
Reply all
Reply to author
Forward
0 new messages