Fix config.py
This commit is contained in:
parent
a8e00eae82
commit
113410fc2d
2 changed files with 4 additions and 3 deletions
|
@ -33,7 +33,6 @@ matrix:
|
|||
- pip install -r requirements.txt
|
||||
- pip install -r dev-requirements.txt
|
||||
script:
|
||||
- python -c "import os; print('CI') if os.getenv('CI') == 'true' else 'unknown'"
|
||||
- pycodestyle wait-for-es
|
||||
- pycodestyle generate-thumb
|
||||
- pycodestyle szurubooru/
|
||||
|
|
|
@ -17,6 +17,8 @@ def merge(left: Dict, right: Dict) -> Dict:
|
|||
|
||||
|
||||
def docker_config() -> Dict:
|
||||
if os.getenv('CI') == 'true':
|
||||
return {}
|
||||
for key in [
|
||||
'POSTGRES_USER',
|
||||
'POSTGRES_PASSWORD',
|
||||
|
@ -51,8 +53,8 @@ def read_config() -> Dict:
|
|||
if os.path.exists('../config.yaml'):
|
||||
with open('../config.yaml') as handle:
|
||||
ret = merge(ret, yaml.load(handle.read()))
|
||||
# if os.path.exists('/.dockerenv') and os.getenv('CI', '') != 'true':
|
||||
# ret = merge(ret, docker_config())
|
||||
if os.path.exists('/.dockerenv'):
|
||||
ret = merge(ret, docker_config())
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Reference in a new issue