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
Post a Comment