Skip to content

Alert admins by email if provisioning fails

Boros Gábor requested to merge ekolpakov/failed-provision-email into master

Created by: e-kolpakov

Description: Sends email notifications to server admins if provisioning fails

Testing instructions:

  1. 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
  2. Patch instance.provision so that it is guaranteed to fail, or otherwise ensure provisioning will fail.
  3. Provision an instance.

You should receive an email with details on what went wrong: image

Note there are two flavors of "failure":

  1. Unhandled exception
  2. deploy returned non-zero exit code.

Emails are slightly different, example screenshot is for deploy returned non-zero exit code failure.

Merge request reports