[Opendnssec-develop] RE: Jenkins email notifications
Yuri Schaeffer
yuri at nlnetlabs.nl
Fri Apr 5 11:26:50 UTC 2013
On 04-04-13 17:00, Sara Dickinson wrote:
> I've also changed the subject format slightly so the build status is
> the first item in the subject line so it is easier to see at a glance
> if the mail is for fixed or failed. If anyone has any other
> suggestions please let me know!
Thanks Sara! That's helpful.
Additionally I started using the follow script yesterday to persistently
insult me every 10 minutes when the enforcer NG is broken. Tested on
gnome3. Add profanity to taste.
---
#!/usr/bin/env python
import feedparser
import sys, os, time
time.sleep(15) #make sure notify daemon started
import pynotify
URL =
"https://jenkins.opendnssec.org/job/build-opendnssec-enforcer-ng/rssAll"
STATUS = {"stable":0, "normal":1, "broken":2}
IMG = "/home/yuri/.ods-build-notify.png"
def status(title):
for k,v in STATUS.iteritems():
if title.find(k) >= 0:
return v,k
print("Fix you damned program")
sys.exit(1)
pynotify.init("ods-build")
s = 0
while True:
feed = feedparser.parse(URL)
title = feed["items"][0].title
state, desc = status(title)
if s == 2 and state == 1:
# only notify once
n = pynotify.Notification("The build is now fixed", title, IMG)
n.show()
elif state == 2:
n = pynotify.Notification("You broke the build, bud!", title, IMG)
n.set_urgency(pynotify.URGENCY_CRITICAL)
n.add_action("a", "I'll fix it now!", str)
n.add_action("a", "I'll fix it now!", str)
n.show()
s = state
time.sleep(600)
More information about the Opendnssec-develop
mailing list