From 59647e07845918ea410253ccc1704072c3ef400b Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Mon, 20 Apr 2020 22:08:48 +0530 Subject: [PATCH 1/3] chore: skip restart on bench setup requirements Signed-off-by: Chinmay D. Pai --- bench/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/utils.py b/bench/utils.py index 84ce6e71..bfaba366 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -572,7 +572,7 @@ def update_requirements(bench_path='.'): update_env_pip(bench_path) for app in get_apps(): - install_app(app, bench_path=bench_path, skip_assets=True) + install_app(app, bench_path=bench_path, skip_assets=True, postprocess=False) def update_node_packages(bench_path='.'): From a4a9b59f4256d5f28ecc572cf5e7e777635e176a Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Tue, 19 May 2020 18:17:38 +0530 Subject: [PATCH 2/3] fix: build assets regardless of postprocess Signed-off-by: Chinmay D. Pai --- bench/app.py | 5 +++-- bench/utils.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bench/app.py b/bench/app.py index 8b165b2b..1ae32e1f 100755 --- a/bench/app.py +++ b/bench/app.py @@ -187,9 +187,10 @@ def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess= add_to_appstxt(app, bench_path=bench_path) + if not skip_assets: + build_assets(bench_path=bench_path, app=app) + if postprocess: - if not skip_assets: - build_assets(bench_path=bench_path, app=app) conf = get_config(bench_path=bench_path) if conf.get('restart_supervisor_on_update'): diff --git a/bench/utils.py b/bench/utils.py index d460f37c..37d3e770 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -285,7 +285,7 @@ def clone_apps_from(bench_path, clone_from, update_app=True): subprocess.check_output(['git', 'reset', '--hard'], cwd=app_path) subprocess.check_output(['git', 'pull', '--rebase', remote, branch], cwd=app_path) - install_app(app, bench_path) + install_app(app, bench_path, postprocess=False) with open(os.path.join(clone_from, 'sites', 'apps.txt'), 'r') as f: apps = f.read().splitlines() From e52dc985c73ee55e46528007d5cae383459f2215 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Tue, 19 May 2020 18:23:59 +0530 Subject: [PATCH 3/3] chore: rename postprocess to restart_bench Signed-off-by: Chinmay D. Pai --- bench/app.py | 6 +++--- bench/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bench/app.py b/bench/app.py index 1ae32e1f..abea32ce 100755 --- a/bench/app.py +++ b/bench/app.py @@ -98,7 +98,7 @@ def remove_from_excluded_apps_txt(app, bench_path='.'): apps.remove(app) return write_excluded_apps_txt(apps, bench_path=bench_path) -def get_app(git_url, branch=None, bench_path='.', skip_assets=False, verbose=False, postprocess=True, overwrite=False): +def get_app(git_url, branch=None, bench_path='.', skip_assets=False, verbose=False, restart_bench=True, overwrite=False): if not os.path.exists(git_url): if not check_url(git_url, raise_err=False): orgs = ['frappe', 'erpnext'] @@ -172,7 +172,7 @@ def new_app(app, bench_path='.'): install_app(app, bench_path=bench_path) -def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess=True, skip_assets=False): +def install_app(app, bench_path=".", verbose=False, no_cache=False, restart_bench=True, skip_assets=False): logger.info("installing {}".format(app)) pip_path = os.path.join(bench_path, "env", "bin", "pip") @@ -190,7 +190,7 @@ def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess= if not skip_assets: build_assets(bench_path=bench_path, app=app) - if postprocess: + if restart_bench: conf = get_config(bench_path=bench_path) if conf.get('restart_supervisor_on_update'): diff --git a/bench/utils.py b/bench/utils.py index 37d3e770..7e7770a1 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -285,7 +285,7 @@ def clone_apps_from(bench_path, clone_from, update_app=True): subprocess.check_output(['git', 'reset', '--hard'], cwd=app_path) subprocess.check_output(['git', 'pull', '--rebase', remote, branch], cwd=app_path) - install_app(app, bench_path, postprocess=False) + install_app(app, bench_path, restart_bench=False) with open(os.path.join(clone_from, 'sites', 'apps.txt'), 'r') as f: apps = f.read().splitlines() @@ -570,7 +570,7 @@ def update_requirements(bench_path='.'): update_env_pip(bench_path) for app in get_apps(): - install_app(app, bench_path=bench_path, skip_assets=True, postprocess=False) + install_app(app, bench_path=bench_path, skip_assets=True, restart_bench=False) def update_node_packages(bench_path='.'):