diff options
author | 2018-05-31 15:52:28 +0100 | |
---|---|---|
committer | 2018-05-31 15:52:28 +0100 | |
commit | 0d5aa90e7d2f4e5e177aecb690ee00c801eb8b1d (patch) | |
tree | 7cab3982b9f577d6b950144f89bf71d958316d9f /gunicorn_config.py | |
parent | [Jams] Add mod-log logging of code jam application status (diff) |
[Gunicorn] Announce site deployment
Diffstat (limited to 'gunicorn_config.py')
-rw-r--r-- | gunicorn_config.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gunicorn_config.py b/gunicorn_config.py index 6c9cf04a..c7d9dcd3 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -2,7 +2,10 @@ import re from kombu import Connection -from pysite.constants import RMQ_HOST, RMQ_PASSWORD, RMQ_PORT, RMQ_USERNAME +from pysite.constants import ( + BOT_EVENT_QUEUE, BotEventTypes, DEBUG_MODE, + RMQ_HOST, RMQ_PASSWORD, RMQ_PORT, RMQ_USERNAME, + CHANNEL_DEV_LOGS) from pysite.migrations.runner import run_migrations from pysite.queues import QUEUES @@ -46,3 +49,16 @@ def _when_ready(server=None, output_func=None): for name, queue in QUEUES.items(): queue.declare(channel=channel) output(f"Queue declared: {name}") + + if not DEBUG_MODE: + producer = c.Producer() + producer.publish( + { + "event": BotEventTypes.send_embed, + "data": { + "target": CHANNEL_DEV_LOGS, + "title": "Site Deployment", + "message": "The site has been deployed!" + } + }, + routing_key=BOT_EVENT_QUEUE) |