mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 09:14:04 +00:00
feat: Option to provide path to Procfile
This commit is contained in:
parent
503bad0045
commit
5bedd2cb52
@ -5,10 +5,11 @@ import sys, os, copy
|
|||||||
@click.command('start')
|
@click.command('start')
|
||||||
@click.option('--no-dev', is_flag=True, default=False)
|
@click.option('--no-dev', is_flag=True, default=False)
|
||||||
@click.option('--concurrency', '-c', type=str)
|
@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"
|
"Start Frappe development processes"
|
||||||
from bench.utils import start
|
from bench.utils import start
|
||||||
start(no_dev=no_dev, concurrency=concurrency)
|
start(no_dev=no_dev, concurrency=concurrency, procfile=procfile)
|
||||||
|
|
||||||
|
|
||||||
@click.command('restart')
|
@click.command('restart')
|
||||||
|
@ -317,7 +317,7 @@ def get_program(programs):
|
|||||||
def get_process_manager():
|
def get_process_manager():
|
||||||
return get_program(['foreman', 'forego', 'honcho'])
|
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()
|
program = get_process_manager()
|
||||||
if not program:
|
if not program:
|
||||||
raise Exception("No process manager found")
|
raise Exception("No process manager found")
|
||||||
@ -329,6 +329,9 @@ def start(no_dev=False, concurrency=None):
|
|||||||
if concurrency:
|
if concurrency:
|
||||||
command.extend(['-c', concurrency])
|
command.extend(['-c', concurrency])
|
||||||
|
|
||||||
|
if procfile:
|
||||||
|
command.extend(['-f', procfile])
|
||||||
|
|
||||||
os.execv(program, command)
|
os.execv(program, command)
|
||||||
|
|
||||||
def check_cmd(cmd, cwd='.'):
|
def check_cmd(cmd, cwd='.'):
|
||||||
|
Loading…
Reference in New Issue
Block a user