Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grouping and decorating groups of parameters in Jenkins

I'm writing a Jenkins pipeline job with quite a few parameters and I'm looking for a way to visually group them together so they will be easier to understand -rather than have them all just thrown in there. I'll settle for anything that at least hints a the fact that these parameters are related to each other. Could be a header, could be boxes. Is there any plugin that will help me decorate my inputs this way?

enter image description here

like image 360
Mig82 Avatar asked Jun 29 '17 09:06

Mig82


People also ask

What are parameters in Jenkins?

Jenkins : Parameterized Build You want to have developers do local builds and let them submit builds for test execution on Jenkins. In such a case, your parameter is a zip file that contains a distribution. Your test suite takes so much time to run that in normal execution you can't afford to run the entire test cycle.

What is string parameter Jenkins?

The validating string parameter plugin contributes a new parameter type to Jenkins that supports regular expression validation of the user's entered parameter.


1 Answers

for dsl you can specify:

String sectionHeaderStyleCss = ' color: white; background: green; font-family: Roboto, sans-serif !important; padding: 5px; text-align: center; '

String separatorStyleCss = ' border: 0; border-bottom: 1px dashed #ccc; background: #999; '

pipelineJob("Foo-job") {
    description("FOO with separators")

    parameters {
        parameterSeparatorDefinition {
            name('FOO_1')
            separatorStyle(separatorStyleCss)
            sectionHeader('FOO_1')
            sectionHeaderStyle(sectionHeaderStyleCss)
        }

Don't make the silly mistake of using the name sectionHeaderStyle as per example in your dsl as that will conflict with the constructor!

which you will obviously spot when you see the error: No signature of method: java.lang.String.call() is applicable for argument types: (java.lang.String) values: []

like image 105
MSillence Avatar answered Sep 20 '22 12:09

MSillence