diff --git a/Main/management/commands/success_deploy.py b/Main/management/commands/success_deploy.py new file mode 100644 index 0000000..4c65a0c --- /dev/null +++ b/Main/management/commands/success_deploy.py @@ -0,0 +1,10 @@ +from django.contrib.auth.models import User +from django.core.management import BaseCommand + +from Main.management.commands.bot import bot + + +class Command(BaseCommand): + def handle(self, *args, **options): + for user in User.objects.filter(is_superuser=True): + bot.send_message(user.userinfo.telegram_chat_id, "Деплой прошел успешно") diff --git a/docker-compose.yaml b/docker-compose.yaml index b84d335..6992851 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -79,4 +79,16 @@ services: - storage volumes: - /sprint-data/solutions:/usr/src/app/solutions - - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file + - /var/run/docker.sock:/var/run/docker.sock + + notify-admin: + image: mathwave/sprint-repo:sprint + command: ./manage.py success_deploy + depends_on: + - migrations + - web + - worker + - storage + - rabbitmq + - bot + - postgres