From 113410fc2d707ca9fbf5f9a8e277c3a13effb28b Mon Sep 17 00:00:00 2001 From: nothink Date: Thu, 26 Jul 2018 01:28:12 +0900 Subject: [PATCH] Fix config.py --- .travis.yml | 1 - server/szurubooru/config.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0d57472..a54c7e82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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/ diff --git a/server/szurubooru/config.py b/server/szurubooru/config.py index 90958255..6d10944a 100644 --- a/server/szurubooru/config.py +++ b/server/szurubooru/config.py @@ -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