Initiate script/email BEFORE SCM polling

47 views
Skip to first unread message

Jeff

unread,
Sep 22, 2015, 4:48:36 PM9/22/15
to Jenkins Users

I have someone in our development group, who insists on receiving an email, no matter whether there are SCM changes initiating a build, or not (polling at scheduled times throughout the day).  They want evidence that the process is running at the scheduled times, whether a build is occurring or not <eyeroll />.

The Editable Email Notification plug-in triggers seems to all require that a build has occurred in some fashion.  It sounds like there's been discussion on adding options to tie in to the SCM polling itself, but no movement to date.

I tried a 'Prepare an environment for run' script, but again, it apparently isn't called unless there are SCM changes.

Does anyone know of a trick, to run a script prior to SCM polling?

Thanks.

Slide

unread,
Sep 22, 2015, 4:53:42 PM9/22/15
to Jenkins Users
You are right, I haven't added the email before/after SCM polling, its an open issue [1] that I haven't been able to design into email-ext as well as I would like. I'm not sure what people want since the "triggering" isn't as varied (SCMPollListener really only has 3 outcomes). If you have ideas on what would be desired, I would be more than happy to take another look.

slide


--
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/5ad68688-3825-4060-ab18-868726f739fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff

unread,
Sep 22, 2015, 5:17:04 PM9/22/15
to Jenkins Users
At this point, I would take a trigger on ANY SCM polling outcome. 
-Jeff

Slide

unread,
Sep 22, 2015, 5:27:39 PM9/22/15
to Jenkins Users
I'll see if I can put something initial together tonight.

Mark Waite

unread,
Sep 22, 2015, 6:22:15 PM9/22/15
to Jenkins Users
If you're a git user, is there a way to create a hook in the repository which would send e-mail on every polling request to the repository?  That might rapidly persuade them that they really don't want to know it is doing it.

Another alternative would be to connect a python or groovy script into your network or systems monitoring software which would raise an alarm if polling were missed.  We had a systems monitoring connection to our Jenkins server previously and I found it very helpful.

Mark Waite

Rob Mandeville

unread,
Sep 29, 2015, 9:36:13 AM9/29/15
to jenkins...@googlegroups.com, Rob Mandeville

An alternate way of handling this is to stop polling.  Or rather, poll explicitly.

 

Have a job which runs every n minutes/hours and does the following:

 

1: Pull the latest version

2: Check it against a version file in the workspace (never clean the workspace)

3: If the latest version is the same as what’s in the version file, you succeeded.

4: If the latest version is different, or if there is no version file:

  A: Use an API call or the Scriptler plugin or something to run a second job that does the actual build.  Don’t wait for it to finish.

  B: Put the new version into the version file

  C: You succeeded.

 

 

The job described above can send email on every poll, and the job it calls can send email on every build.

 

--Rob

--

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/5ad68688-3825-4060-ab18-868726f739fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.



This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
Reply all
Reply to author
Forward
0 new messages