From 67b807daec66fd2d2153b1467ac962618f0e1c94 Mon Sep 17 00:00:00 2001 From: Valerij Maljulin Date: Mar 26 2021 10:40:27 +0000 Subject: [PATCH 1/2] Update .gitignore file --- diff --git a/.gitignore b/.gitignore index bd2bf26..ddebfb2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ eggs/ /rpmbuild-output/ conf/settings.py *.src.rpm - +greenwave-image-build.sh # Vim temporary files *~ @@ -29,6 +29,7 @@ greenwave-test-cache.dbm* # virtualenv .venv/ +venv/ # Other .idea From 744e06053f6c8458cf88bee201cc5bbce1a653e6 Mon Sep 17 00:00:00 2001 From: Valerij Maljulin Date: Mar 26 2021 10:40:27 +0000 Subject: [PATCH 2/2] Support for the readthedocs.org documentation building JIRA: RHELWF-2808 --- diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..37b074e --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,16 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.8 + install: + - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..aaeaf77 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,6 @@ +flask +sphinx +sphinxcontrib-httpdomain +prometheus_client +dogpile.cache +PyYAML diff --git a/greenwave/utils.py b/greenwave/utils.py index d09fec9..bea6e57 100644 --- a/greenwave/utils.py +++ b/greenwave/utils.py @@ -76,15 +76,19 @@ def load_config(config_obj=None): if config_obj is None: if os.getenv('TEST') == 'true': config_obj = 'greenwave.config.TestingConfig' - elif os.getenv('DEV') == 'true': + elif os.getenv('DEV') == 'true' or os.getenv('DOCS') == 'true': config_obj = 'greenwave.config.DevelopmentConfig' else: config_obj = 'greenwave.config.ProductionConfig' if os.getenv('TEST') == 'true': - default_config_file = os.getcwd() + '/conf/settings.py.example' + default_config_file = os.path.join(os.getcwd(), 'conf', 'settings.py.example') elif os.getenv('DEV') == 'true': - default_config_file = os.getcwd() + '/conf/settings.py' + default_config_file = os.path.join(os.getcwd(), 'conf', 'settings.py') + elif os.getenv('DOCS') == 'true': + default_config_file = os.path.normpath( + os.path.join(os.getcwd(), '..', 'conf', 'settings.py.example') + ) else: default_config_file = '/etc/greenwave/settings.py'