Rerun of seed job on template change ("using" keyword)

20 views
Skip to first unread message

Tobias König

unread,
Sep 21, 2016, 5:30:34 AM9/21/16
to job-dsl-plugin
Hi,

I'm using the "using" keyword keyword to create a bunch of jobs basing on a Jenkins job:

// build parameters
def someParam1 = binding['Some Param 1'].toString()
def someParam2 = binding['Some Param 2'].toString()

Jenkins.getInstance().getJobNames().each { jobName ->
    if (someCondition) {
        job(targetJobName) {
            using(jobName)
            // use someParam1 and someParam2 in the DSL
            ...

Now, whenever a template job (jobName) changes the above seed job reruns, due to the semantics of the "using" keyword. However, since the rerun happens with default build parameters, all child jobs are updated with non-functioning (default) parameters.

How can I
  1. disable the rerun functionality of the "using" keyword?
  2. let "using" perform the rerun with the values originally used for the creation of the child jobs?
Best regards,
Tobias
Reply all
Reply to author
Forward
0 new messages