From 8cfd762c619cc4f7585f795b28d40a0814e1523a Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Thu, 13 Aug 2020 13:48:46 +0530 Subject: [PATCH] feat: frappe commands execute frappe commands with bench --- build/common/worker/docker-entrypoint.sh | 7 +++++++ tests/docker-test.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/build/common/worker/docker-entrypoint.sh b/build/common/worker/docker-entrypoint.sh index 2ad58b9c..171de971 100755 --- a/build/common/worker/docker-entrypoint.sh +++ b/build/common/worker/docker-entrypoint.sh @@ -201,6 +201,13 @@ elif [ "$1" = 'restore-backup' ]; then && python /home/frappe/frappe-bench/commands/restore_backup.py" exit +elif [ "$1" = 'bench' ]; then + + exec su frappe -c '/home/frappe/frappe-bench/env/bin/python \ + /home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py \ + frappe "$@"' + exit + else exec su frappe -c "$@" diff --git a/tests/docker-test.sh b/tests/docker-test.sh index 48c16e21..d81e2b0b 100755 --- a/tests/docker-test.sh +++ b/tests/docker-test.sh @@ -408,3 +408,9 @@ docker run \ -v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \ --network frappebench00_default \ frappe/erpnext-worker:edge console pgsql.localhost + +echo -e "\e[1m\e[4mCheck bench --help\e[0m" +docker run \ + -v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \ + --network frappebench00_default \ + frappe/erpnext-worker:edge bench --help