From 3c13f8387e1327259540dff05edc4ec4532bd994 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 18 Jun 2018 18:49:23 +0300 Subject: Add: controller URL to notification mails --- ick2/sendmail.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'ick2') diff --git a/ick2/sendmail.py b/ick2/sendmail.py index 423b9f6..2c2b4d4 100644 --- a/ick2/sendmail.py +++ b/ick2/sendmail.py @@ -19,14 +19,15 @@ import smtplib body_tmpl = """\ -This is a notification from ick, the CI system. +This is a build notification from ick. -Project: {project} -Build ID: {build_id} -Log ID: {log} -Worker: {worker} -Status: {status} -Exit code: {exit_code} +Controller: {controller_url} +Project: {project} +Build ID: {build_id} +Log ID: {log} +Worker: {worker} +Status: {status} +Exit code: {exit_code} Build log is attached. @@ -37,6 +38,7 @@ class Sendmail: config_fields = [ 'from_addr', + 'controller_url', 'smtp_server', 'smtp_port', 'smtp_user', @@ -79,7 +81,8 @@ class Sendmail: def get_body(self, build): msg = email.message.Message() - msg.set_payload(body_tmpl.format(**build)) + msg.set_payload(body_tmpl.format( + controller_url=self._config['controller_url'], **build)) msg.add_header('Content-Type', 'text/plain') return msg -- cgit v1.2.1