2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

feat: Option to provide path to Procfile

This commit is contained in:
Faris Ansari 2019-08-24 19:55:32 +05:30
parent 503bad0045
commit 5bedd2cb52
2 changed files with 7 additions and 3 deletions

View File

@ -5,10 +5,11 @@ import sys, os, copy
@click.command('start')
@click.option('--no-dev', is_flag=True, default=False)
@click.option('--concurrency', '-c', type=str)
def start(no_dev, concurrency):
@click.option('--procfile', '-p', type=str)
def start(no_dev, concurrency, procfile):
"Start Frappe development processes"
from bench.utils import start
start(no_dev=no_dev, concurrency=concurrency)
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile)
@click.command('restart')

View File

@ -317,7 +317,7 @@ def get_program(programs):
def get_process_manager():
return get_program(['foreman', 'forego', 'honcho'])
def start(no_dev=False, concurrency=None):
def start(no_dev=False, concurrency=None, procfile=None):
program = get_process_manager()
if not program:
raise Exception("No process manager found")
@ -329,6 +329,9 @@ def start(no_dev=False, concurrency=None):
if concurrency:
command.extend(['-c', concurrency])
if procfile:
command.extend(['-f', procfile])
os.execv(program, command)
def check_cmd(cmd, cwd='.'):