templates_events_modulesdir = $(templates_eventsdir)/modules
+templates_jobsdir = $(templatesdir)/jobs
+
+dist_templates_jobs_messages_DATA = \
+ src/templates/jobs/messages/failed.txt
+
+templates_jobs_messagesdir = $(templates_jobsdir)/messages
+
templates_messagesdir = $(templatesdir)/messages
dist_templates_messages_builds_DATA = \
templates_messages_buildsdir = $(templates_messagesdir)/builds
-dist_templates_messages_jobs_DATA = \
- src/templates/messages/jobs/failed.markdown \
- src/templates/messages/jobs/finished.markdown
-
-templates_messages_jobsdir = $(templates_messagesdir)/jobs
-
dist_templates_messages_users_DATA = \
src/templates/messages/users/email-activation.markdown
# Store message
self._set_attribute("message", message)
- # Notify users
- if success:
- #self.send_finished_message()
- pass # XXX send_finished_message() is currently broken
- else:
+ # Handle any unsuccessful jobs
+ if not success:
+ # Mark as failed
self._set_attribute("failed", True)
- self.send_failed_message()
+
+ # Notify the owner
+ if self.owner:
+ self.owner.send_message("jobs/messages/failed.txt", job=self)
# XXX propagate any changes to the build
return pkgs
- def send_finished_message(self):
- # Send no finished mails for test jobs.
- if self.test:
- return
-
- logging.debug("Sending finished message for job %s to %s" % \
- (self.name, ", ".join(self.message_recipients)))
-
- self.backend.messages.send_template_to_many(self.message_recipients,
- "messages/jobs/finished", job=self)
-
- def send_failed_message(self):
- logging.debug("Sending failed message for job %s to %s" % \
- (self.name, ", ".join(self.message_recipients)))
-
- self.backend.messages.send_template_to_many(self.message_recipients,
- "messages/jobs/failed", job=self)
-
@property
def pakfire(self):
"""
-Subject: [{{ job.name }}] {{ _("Build job failed") }}
+Subject: [{{ job.name }}] {{ _("Build Job Failed") }}
{{ _("The build job %s has failed") % job.name }}.
{{ _("This could have a couple of reasons and needs to be investigated by you.") }}
{{ _("Click on this link to get all details about the build:") }}
{{ baseurl }}/job/{{ job.uuid }}
-{{ _("Sincerely,") }}
--{{ _("The Pakfire Build Service") }}
\ No newline at end of file
+{{ _("Sincerely,") }}
+-{{ _("The Pakfire Build Service") }}
+++ /dev/null
-Subject: [{{ job.name }}] {{ _("Build job finished") }}
-
-{{ _("The build job %s has finished") % job.name }}.
-
-{{ _("If you are the maintainer, it is up to you to push it to one or more repositories.") }}
-
-{{ _("Click on this link to get all details about the build:") }}
- {{ baseurl }}/job/{{ job.uuid }}
-
-{{ _("Sincerely,") }}
--{{ _("The Pakfire Build Service") }}
\ No newline at end of file