From 4c173ded26a2e36651706439f58401ffafea6ac7 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Thu, 5 Mar 2020 18:26:48 +0530 Subject: [PATCH] feat(procfile): dont add redis to procfile if skipping config gen Signed-off-by: Chinmay D. Pai --- bench/config/procfile.py | 5 +++-- bench/config/templates/Procfile | 2 ++ bench/utils.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bench/config/procfile.py b/bench/config/procfile.py index 3dd7cece..9dbe55b3 100755 --- a/bench/config/procfile.py +++ b/bench/config/procfile.py @@ -3,7 +3,7 @@ from bench.utils import find_executable from bench.app import use_rq from bench.config.common_site_config import get_config -def setup_procfile(bench_path, yes=False): +def setup_procfile(bench_path, yes=False, setup_redis=True): config = get_config(bench_path=bench_path) procfile_path = os.path.join(bench_path, 'Procfile') if not yes and os.path.exists(procfile_path): @@ -14,7 +14,8 @@ def setup_procfile(bench_path, yes=False): node=find_executable("node") or find_executable("nodejs"), use_rq=use_rq(bench_path), webserver_port=config.get('webserver_port'), - CI=os.environ.get('CI')) + CI=os.environ.get('CI'), + setup_redis=setup_redis) with open(procfile_path, 'w') as f: f.write(procfile) diff --git a/bench/config/templates/Procfile b/bench/config/templates/Procfile index b9c81118..f1083dcc 100644 --- a/bench/config/templates/Procfile +++ b/bench/config/templates/Procfile @@ -1,6 +1,8 @@ +{% if setup_redis %} redis_cache: redis-server config/redis_cache.conf redis_socketio: redis-server config/redis_socketio.conf redis_queue: redis-server config/redis_queue.conf +{% endif %} web: bench serve {% if webserver_port -%} --port {{ webserver_port }} {%- endif %} socketio: {{ node }} apps/frappe/socketio.js diff --git a/bench/utils.py b/bench/utils.py index 4b4b518a..4f6c4dff 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -147,7 +147,7 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, redis.generate_config(path) if not no_procfile: - setup_procfile(path) + setup_procfile(path, setup_redis=skip_redis_config_generation) if not no_backups: setup_backups(bench_path=path)