Jenkins Job DSL Trigger deprecation

780 views
Skip to first unread message

dermutz

unread,
Jul 5, 2020, 6:21:54 AM7/5/20
to job-dsl-plugin
Hello,

I have got a problem regarding the trigger, It is deprecated, but I don´t get it running with the new
version, since the deprecation warning is still shown.

Here the code before:

protected def job
 void nightly(String schedule='H 0 * * *') {
        job.triggers {
            cron(schedule)
        }
    }

Then the update according to: https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration

void nightly(String schedule='H 0 * * *') {
        properties {
            pipelineTriggers {
                job.triggers {
                    cron(schedule)
                }
            }
        }
    }

There is still a warning: Warning: (JobBuilder.groovy, line 100) triggers is deprecated What am I doing wrong? thanks in advance

Matt Sheehan

unread,
Jul 6, 2020, 2:53:08 PM7/6/20
to job-dsl-plugin
You're still calling triggers on the job object. It might work if you do:

void nightly(String schedule='H 0 * * *') {
        properties {
            pipelineTriggers {
               triggers {
                    cron(schedule)
                }
            }
        }
    }

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/9225bae7-e745-4d72-8032-1cb3ba5080fbo%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages