Alert admins by email if provisioning fails
Created by: e-kolpakov
Description: Sends email notifications to server admins if provisioning fails
Testing instructions:
- Provide email settings in .env file:
1.1.
ADMINS='[["you", "you@opencraft.com"]]'
1.2.SERVER_EMAIL = 'you@opencraft.com'
# SMTP Server refuses connections from unknown hosts 1.3. EMAIL_HOST, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD - from opencraft/secrets repository - Patch
instance.provision
so that it is guaranteed to fail, or otherwise ensure provisioning will fail. - Provision an instance.
You should receive an email with details on what went wrong:
Note there are two flavors of "failure":
- Unhandled exception
-
deploy
returned non-zero exit code.
Emails are slightly different, example screenshot is for deploy
returned non-zero exit code failure.