diff --git a/rogerthat/app/rogerthat.py b/rogerthat/app/rogerthat.py index d76e2ce..65ae333 100644 --- a/rogerthat/app/rogerthat.py +++ b/rogerthat/app/rogerthat.py @@ -81,7 +81,7 @@ def start_queues(self): self._mqtt_queue = mqtt_queue.get_instance() def start_server(self): - logger.info("RogerThat startup.") + logger.info(f"RogerThat v{Config.get_inst().version} starting.") self.setup_loop() self.start_queues() logger.info("Starting RogerThat Server.") diff --git a/rogerthat/config/config.py b/rogerthat/config/config.py index 7550b78..96822d8 100644 --- a/rogerthat/config/config.py +++ b/rogerthat/config/config.py @@ -3,6 +3,7 @@ from rogerthat.config.loader import config_loader from rogerthat.utils.class_helpers import no_setters +from rogerthat.utils.version_number import get_version_number _loaded_configs = config_loader() _app_config = _loaded_configs.app_config @@ -15,6 +16,7 @@ class Config(no_setters): # Main App _project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) + _version = get_version_number(_project_root) _app_name = _app_config['app_name'] _debug_mode = _app_config['debug_mode'] diff --git a/rogerthat/utils/version_number.py b/rogerthat/utils/version_number.py new file mode 100644 index 0000000..67b537e --- /dev/null +++ b/rogerthat/utils/version_number.py @@ -0,0 +1,9 @@ +import os + + +def get_version_number(root_folder): + version = None + with open(os.path.join(root_folder, "VERSION"), "r") as fp: + version = fp.readlines(1)[0] + + return version