How to access list of Jenkins job parameters from within a JobDSL script? -


i save parameters passed jobdsl job. know can refer individual parameters make code generic. how access list of parameters passed job?

the current code looks like:

final jobparameters = new file('parameters') jobparameters.write("""     |aoeu=${aoeu}     |snth=${snth} """[1..-1].stripmargin().trim()) 

i able like:

final jobparameters = new file('parameters') jobparameters.write(params.iterator().join('\n')) 

params that's available in build flow plugin not jobdsl plugin.

the dsl not offer access build parameters. script has access jenkins object model, can use jenkins api retrieve current build , parameters:

import hudson.model.*  build build = executor.currentexecutor().currentexecutable parametersaction parametersaction = build.getaction(parametersaction) parametersaction.parameters.each { parametervalue v ->     println v } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -