Declarative script: specify build trigger in GUI or script?

24 views
Skip to first unread message

David Aldrich

unread,
May 22, 2017, 10:00:21 AM5/22/17
to jenkins...@googlegroups.com
Hi,

I'm confused about how to specify a build trigger for a declarative script. I want the job to be triggered by an SCM commit so I specified in my script:

triggers {
pollSCM('H/5 * * * *')
}

to poll every 5 minutes.

However, the job is not being run even though commits have occurred.

I notice that there is also a 'Build trigger' section in the GUI configuration for a branch of the job.

Where should I specify the build trigger: in the GUI or in the script?

Best regards

David

Andrew Bayer

unread,
May 24, 2017, 8:44:08 AM5/24/17
to jenkins...@googlegroups.com
A couple questions - is this being specified in a Jenkinsfile coming from SCM? Have you run the build once? 

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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e7db9b43810040769c28a1de2fefcee3%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.

David Aldrich

unread,
May 24, 2017, 9:10:05 AM5/24/17
to jenkins...@googlegroups.com

Hi Andrew,

 

Yes the polling is specified in the JenkinsFile, which does come from SCM.  I found that the polling ran fine after I had manually run the build once, as you intimated. So it’s working fine now.

 

I don’t know how one should now that it’s necessary to run the build manually once. However, I also realise that it is hard to know where to document that sort of thing.

 

I do think it is confusing that the polling schedule can be specified in the GUI and/or in the script.

 

Best regards

 

David

 


For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.

Reply all
Reply to author
Forward
0 new messages