diff --git a/bench/config/procfile.py b/bench/config/procfile.py index 7feaab722..5b881a3e4 100755 --- a/bench/config/procfile.py +++ b/bench/config/procfile.py @@ -4,12 +4,14 @@ import click import bench -from bench.app import use_rq from bench.bench import Bench from bench.utils import which -def setup_procfile(bench_path, yes=False, skip_redis=False): +def setup_procfile(bench_path, yes=False, skip_redis=False, skip_web=False, skip_watch=None, skip_socketio=False, skip_schedule=False, with_coverage=False): + if skip_watch is None: + # backwards compatibilty; may be eventually removed + skip_watch = os.environ.get("CI") config = Bench(bench_path).conf procfile_path = os.path.join(bench_path, "Procfile") @@ -25,10 +27,13 @@ def setup_procfile(bench_path, yes=False, skip_redis=False): .get_template("Procfile") .render( node=which("node") or which("nodejs"), - use_rq=use_rq(bench_path), webserver_port=config.get("webserver_port"), - CI=os.environ.get("CI"), skip_redis=skip_redis, + skip_web=skip_web, + skip_watch=skip_watch, + skip_socketio=skip_socketio, + skip_schedule=skip_schedule, + with_coverage=with_coverage, workers=config.get("workers", {}), is_mac=is_mac, ) diff --git a/bench/config/templates/Procfile b/bench/config/templates/Procfile index 1f2440fb5..199b8b2bd 100644 --- a/bench/config/templates/Procfile +++ b/bench/config/templates/Procfile @@ -2,15 +2,18 @@ redis_cache: redis-server config/redis_cache.conf redis_queue: redis-server config/redis_queue.conf {% endif %} -web: bench serve {% if webserver_port -%} --port {{ webserver_port }} {%- endif %} - +{% if not skip_web %} +web: bench serve {% if with_coverage -%} --with-coverage {%- endif %} {% if webserver_port -%} --port {{ webserver_port }} {%- endif %} +{% endif %} +{% if not skip_socketio %} socketio: {{ node }} apps/frappe/socketio.js - -{% if not CI %} +{% endif %} +{% if not skip_watch %} watch: bench watch {% endif %} - +{% if not skip_schedule %} schedule: bench schedule +{% endif %} worker: {{ 'OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES NO_PROXY=*' if is_mac else '' }} bench worker 1>> logs/worker.log 2>> logs/worker.error.log {% for worker_name, worker_details in workers.items() %} worker_{{ worker_name }}: {{ 'OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES NO_PROXY=*' if is_mac else '' }} bench worker --queue {{ worker_name }} 1>> logs/worker.log 2>> logs/worker.error.log