d080ca2cc6
further improve developer morale get initial angular loading Add remote css to config index Starts work to port endpoints into config app Add the api blueprint
21 lines
No EOL
866 B
Python
21 lines
No EOL
866 B
Python
import os
|
|
from util.config.provider import TestConfigProvider, KubernetesConfigProvider, FileConfigProvider
|
|
|
|
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
CONF_DIR = os.getenv("QUAYCONF", os.path.join(ROOT_DIR, "conf/"))
|
|
OVERRIDE_CONFIG_DIRECTORY = os.path.join(CONF_DIR, 'stack/')
|
|
|
|
|
|
def get_config_provider(config_volume, yaml_filename, py_filename, testing=False, kubernetes=False):
|
|
""" Loads and returns the config provider for the current environment. """
|
|
if testing:
|
|
return TestConfigProvider()
|
|
|
|
if kubernetes:
|
|
return KubernetesConfigProvider(config_volume, yaml_filename, py_filename)
|
|
|
|
return FileConfigProvider(config_volume, yaml_filename, py_filename)
|
|
|
|
|
|
config_provider = get_config_provider(OVERRIDE_CONFIG_DIRECTORY, 'config.yaml', 'config.py',
|
|
testing=False, kubernetes=False) |