Does 'trigger' directive in pipeline actually mean only retrigger?

35 views
Skip to first unread message

Vineet Naik

unread,
Sep 22, 2017, 1:03:44 PM9/22/17
to Jenkins Users
Hi,

I have created a job (Jenkins ver. 2.60.3) using pipeline definition and it's 'triggers' directive for eg.

```
    triggers { cron('0 4 * * *') }
```

My expectation was that once the job is created, it would get triggered as per the specified cron expression by the system timer. However it seems the job doesn't get periodically scheduled on creation. Only when it's manually built once, the "Build periodically" field of the config gets populated with the same cron expression as the one in the pipeline definition. Then from next day onwards the job runs at 4 am as expected.

This is just my observation but I also noticed today that the docs do mention that 'triggers' actually means 're-triggers'.

Accepts a cron-style string to define a regular interval at which the Pipeline should be re-triggered


Just want to confirm that my conclusion about this behaviour of pipeline is correct as I couldn't find much clarification about it nor anyone else facing the same issue.

Thanks,
Vineet

Andrew Bayer

unread,
Sep 22, 2017, 5:31:26 PM9/22/17
to jenkins...@googlegroups.com
Yeah, the job has to run at least once after you've added the triggers directive for it to register, and then it'll be fine.

A.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c108a900-0517-4888-9a64-9936dcd37daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vineet Naik

unread,
Sep 24, 2017, 8:03:57 AM9/24/17
to Jenkins Users
Thanks Andrew.


On Saturday, 23 September 2017 03:01:26 UTC+5:30, Andrew Bayer wrote:
Yeah, the job has to run at least once after you've added the triggers directive for it to register, and then it'll be fine.

A.
On Fri, Sep 22, 2017 at 12:54 PM, Vineet Naik <nai...@gmail.com> wrote:
Hi,

I have created a job (Jenkins ver. 2.60.3) using pipeline definition and it's 'triggers' directive for eg.

```
    triggers { cron('0 4 * * *') }
```

My expectation was that once the job is created, it would get triggered as per the specified cron expression by the system timer. However it seems the job doesn't get periodically scheduled on creation. Only when it's manually built once, the "Build periodically" field of the config gets populated with the same cron expression as the one in the pipeline definition. Then from next day onwards the job runs at 4 am as expected.

This is just my observation but I also noticed today that the docs do mention that 'triggers' actually means 're-triggers'.

Accepts a cron-style string to define a regular interval at which the Pipeline should be re-triggered


Just want to confirm that my conclusion about this behaviour of pipeline is correct as I couldn't find much clarification about it nor anyone else facing the same issue.

Thanks,
Vineet

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages