Add ability to set/override values of job parameters#29
Add ability to set/override values of job parameters#29thesvistun wants to merge 1 commit intojenkinsci:masterfrom
Conversation
Could be used in Scheduler field as a commented line. In this field comments follow a sharp sign (#). So start each param line with the sign. Syntax: @param <name> [value] Parameters are applied to a cron item above which they are listed. These parameters values override ones of default job parameters. No quotes are needed in case a parameter value contains whitespaces. A parameter value may be omitted. In this case it will be assumed as an empty one.
|
Hi @thesvistun , Thanks for the PR, I just wanted to clarify what it is you're wanting to do here? Are the params to be passed to the scripts that determine whether or not the job should run? Or are they params that should be set for the resultant triggered job? I think it's a good idea to be able to override the default params of triggered jobs, but I'm not convinced that abusing the scheduling field is the best approach. If you could give some more detail on the use-case and decisions behind your approach, it would be much appreciated |
|
Hi @TonyNoble ! It is not about making decision whether a job needs to be run or not. Parameters should be passed to the triggered job. In general our requirements look like: we have a matrix job that has to be triggered several times a day. This job has to be able to run different set of configurations supplied through its matrix parameter. Other parameters may differ as well through the timetable. That is it. Without changes in this plugin I'm able to parse additional fields got from cron tab right in Groovy script, then to store parsed parameters in a file through which the plugin allows us to override default values of job parameters. But I thought you could be interested in the feature embedded in the plugin. |
|
And yes, using a Scheduler field for the purpose is not a briliant idea. Not terrible on the other hand. So I thought it has a chance to be applied here before some other solution will come. |
Could be used in Scheduler field as a commented line. In this field comments follow a sharp sign (#).
So start each param line with the sign.
Syntax:
@param [value]
Parameters are applied to a cron item above which they are listed. These parameters values override ones of default job parameters. No quotes are needed in case a parameter value contains whitespaces. A parameter value may be omitted. In this case it will be assumed as an empty one.