From 869df66cd3bf759e4432131681ce742d5f22e211 Mon Sep 17 00:00:00 2001 From: mihalin Date: Thu, 9 Sep 2021 19:16:28 +0300 Subject: [PATCH] version add --- .dockerignore | 1 + .gitignore | 1 + docker-compose-release.yaml | 13 +++++++++++-- olgram/commands/start.py | 5 ++++- olgram/settings.py | 4 ++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index e04276f..22d64ae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .idea venv +config.json \ No newline at end of file diff --git a/.gitignore b/.gitignore index bee3282..53dc48d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ venv .idea __pycache__ *.pyc +config.json \ No newline at end of file diff --git a/docker-compose-release.yaml b/docker-compose-release.yaml index febefc3..29fcbc0 100644 --- a/docker-compose-release.yaml +++ b/docker-compose-release.yaml @@ -16,14 +16,23 @@ services: - redis-db:/bitnami/redis/data env_file: - release.env - bot: - build: . + olgram: + image: ghcr.io/civsocit/olgram/bot:stable restart: unless-stopped + labels: + - 'com.centurylinklabs.watchtower.enable="true"' env_file: - release.env depends_on: - postgres - redis + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./config.json:/config.json + command: --interval 30 + volumes: database: diff --git a/olgram/commands/start.py b/olgram/commands/start.py index a821787..eecac7b 100644 --- a/olgram/commands/start.py +++ b/olgram/commands/start.py @@ -5,6 +5,7 @@ from aiogram import types from aiogram.dispatcher import FSMContext from textwrap import dedent +from olgram.settings import OlgramSettings from olgram.router import dp @@ -37,6 +38,8 @@ async def help(message: types.Message, state: FSMContext): """ Команда /help """ - await message.answer(dedent(""" + await message.answer(dedent(f""" + + Version {OlgramSettings.version()} """)) diff --git a/olgram/settings.py b/olgram/settings.py index 96e1a64..e32c578 100644 --- a/olgram/settings.py +++ b/olgram/settings.py @@ -24,6 +24,10 @@ class OlgramSettings(AbstractSettings): """ return 5 + @classmethod + def version(cls): + return "0.0.0" + class BotSettings(AbstractSettings): @classmethod