Send email notifications when builds complete or fail.
Executing actions of an app is called *build*. A build is considered *completed* if all its actions were completed. If some actions were completed and some failed, it's a *partially completed*; if all actions fail, the build *failed*.
This extension sends you emails via SMTP when your builds complete (fully or partially) or fail; just pick the desired notification level, list the recepient emails, and enter your SMTP credentials. Optionally, you can set the subject for each notifcation level.
.. warning::
This extension uses `SMTPHandler <https://docs.python.org/3/library/logging.handlers.html#smtphandler>`__ from logging.handlers. SMTPHandler doesn't work with GMail because it creates an smtplib.SMTP object to connect to the host, whereas GMail requires smtplib.SMTP_SSL.
Outlook.com works fine.
Installation
------------
.. code-block:: bash
$ pip install sloth-ci.ext.build_email_notifications
Usage
-----
.. code-block:: yaml
:caption: build_email_notifications.yml
extensions:
notifications:
# Use the module sloth_ci.ext.build_email_notifications.
module: build_email_notifications
# Emails to send the notifications to.
emails:
- foo@bar.com
- admin@example.com
# Log level (number or valid Python logging level name).
# ERROR includes only build fails, WARNING adds partial completions,
# INFO adds completion, and DEBUG adds trigger notifications.
# Default is WARNING.
level: INFO
# The "from" address in the emails. Default is "build@sloth.ci."
from: notify@example.com
# The email subject on build trigger. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Triggered."
subject_triggered: 'Triggered build on {listen_point}!'
# The email subject on build completion.You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Completed."
subject_completed: 'Hooray! {listen_point} works!'
# The email subject on build partial completion. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Partially Completed."
subject_partially_completed: 'Better than nothing on {listen_point}'
# The email subject on build fail. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Failed."
subject_failed: 'Fail on {listen_point}'
# SMTP settings.
# SMTP mail host and (if not default) port.
# Mandatory parameter.
mailhost: 'smtp-mail.outlook.com:25'
# SMTP login.
login: foo@bar.baz
# SMTP password.
password: bar
# If the SMTP server requires TLS, set this to true. Default is false.
# If necessary, you can provide a keyfile name or a keyfile and a certificate file names.
# This param is used only if the login and password params are supplied.
secure: true
# secure:
# - keyfile
# - cerfile
Executing actions of an app is called *build*. A build is considered *completed* if all its actions were completed. If some actions were completed and some failed, it's a *partially completed*; if all actions fail, the build *failed*.
This extension sends you emails via SMTP when your builds complete (fully or partially) or fail; just pick the desired notification level, list the recepient emails, and enter your SMTP credentials. Optionally, you can set the subject for each notifcation level.
.. warning::
This extension uses `SMTPHandler <https://docs.python.org/3/library/logging.handlers.html#smtphandler>`__ from logging.handlers. SMTPHandler doesn't work with GMail because it creates an smtplib.SMTP object to connect to the host, whereas GMail requires smtplib.SMTP_SSL.
Outlook.com works fine.
Installation
------------
.. code-block:: bash
$ pip install sloth-ci.ext.build_email_notifications
Usage
-----
.. code-block:: yaml
:caption: build_email_notifications.yml
extensions:
notifications:
# Use the module sloth_ci.ext.build_email_notifications.
module: build_email_notifications
# Emails to send the notifications to.
emails:
- foo@bar.com
- admin@example.com
# Log level (number or valid Python logging level name).
# ERROR includes only build fails, WARNING adds partial completions,
# INFO adds completion, and DEBUG adds trigger notifications.
# Default is WARNING.
level: INFO
# The "from" address in the emails. Default is "build@sloth.ci."
from: notify@example.com
# The email subject on build trigger. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Triggered."
subject_triggered: 'Triggered build on {listen_point}!'
# The email subject on build completion.You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Completed."
subject_completed: 'Hooray! {listen_point} works!'
# The email subject on build partial completion. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Partially Completed."
subject_partially_completed: 'Better than nothing on {listen_point}'
# The email subject on build fail. You can use the {listen_point} placeholder.
# Default is "{listen_point}: Build Failed."
subject_failed: 'Fail on {listen_point}'
# SMTP settings.
# SMTP mail host and (if not default) port.
# Mandatory parameter.
mailhost: 'smtp-mail.outlook.com:25'
# SMTP login.
login: foo@bar.baz
# SMTP password.
password: bar
# If the SMTP server requires TLS, set this to true. Default is false.
# If necessary, you can provide a keyfile name or a keyfile and a certificate file names.
# This param is used only if the login and password params are supplied.
secure: true
# secure:
# - keyfile
# - cerfile
Metadata
Release files for sloth-ci.ext.build_email_notifications 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sloth-ci.ext.build_email_notifications-1.0.8.zip | 7.7 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sloth_ci.ext.build_email_notifications-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
| sloth-ci.ext.build_email_notifications-1.0.8.win-amd64.exe | Details |
Total release size: 159.9 kB
Release files / sloth-ci.ext.build_email_notifications-1.0.8.zip
| Download URL | sloth-ci.ext.build_email_notifications-1.0.8.zip |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53228e821e7a853a0b09213be537271c804c34926d18b3c211466f3ae27271d0
|
|
BLAKE2b-256 checksum How to use checksums |
3bb14e1402fd8b12ec415e6e0434bb4796a3de6055f554cc2f2e2a8515b42894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sloth_ci.ext.build_email_notifications-1.0.8-py3-none-any.whl
| Download URL | sloth_ci.ext.build_email_notifications-1.0.8-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4aa45bb58d07ff635c33e66e4baca64dadba4c09794f3cde0799257cbcf686c5
|
|
BLAKE2b-256 checksum How to use checksums |
8ab826b8ff42743746f03f23fbe14d27d08c15b468b01c476764f05d430525a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sloth-ci.ext.build_email_notifications-1.0.8.win-amd64.exe
| Download URL | sloth-ci.ext.build_email_notifications-1.0.8.win-amd64.exe |
|---|---|
| Size | 145.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c89bb55a3a7c8d94afb4ae01deecf9ba6fa1de79c51c96e89495721687c4165
|
|
BLAKE2b-256 checksum How to use checksums |
7811b5a304d1d98c87efd858c1c339b5743725ef878589714f74edf4faf97c00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |