fix: accept args for bench commands
This commit is contained in:
parent
358e1ca7c9
commit
e9080d3952
19
build/common/worker/bench
Executable file
19
build/common/worker/bench
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/home/frappe/frappe-bench/env/bin/python
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
bench_dir = os.path.join(os.sep, 'home', 'frappe', 'frappe-bench')
|
||||||
|
sites_dir = os.path.join(bench_dir, 'sites')
|
||||||
|
bench_helper = os.path.join(
|
||||||
|
bench_dir, 'apps', 'frappe',
|
||||||
|
'frappe', 'utils', 'bench_helper.py',
|
||||||
|
)
|
||||||
|
cwd = os.getcwd()
|
||||||
|
os.chdir(sites_dir)
|
||||||
|
subprocess.check_call(
|
||||||
|
[sys.executable, bench_helper, 'frappe'] + sys.argv[1:],
|
||||||
|
)
|
@ -201,15 +201,8 @@ elif [ "$1" = 'restore-backup' ]; then
|
|||||||
&& python /home/frappe/frappe-bench/commands/restore_backup.py"
|
&& python /home/frappe/frappe-bench/commands/restore_backup.py"
|
||||||
exit
|
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
|
else
|
||||||
|
|
||||||
exec su frappe -c "$@"
|
exec $@
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -57,6 +57,7 @@ USER root
|
|||||||
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
||||||
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
||||||
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
||||||
|
COPY build/common/worker/bench /usr/local/bin/bench
|
||||||
|
|
||||||
# Setup docker-entrypoint
|
# Setup docker-entrypoint
|
||||||
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
|
@ -413,4 +413,5 @@ echo -e "\e[1m\e[4mCheck bench --help\e[0m"
|
|||||||
docker run \
|
docker run \
|
||||||
-v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \
|
-v frappebench00_sites-vol:/home/frappe/frappe-bench/sites \
|
||||||
--network frappebench00_default \
|
--network frappebench00_default \
|
||||||
|
--user frappe \
|
||||||
frappe/erpnext-worker:edge bench --help
|
frappe/erpnext-worker:edge bench --help
|
||||||
|
@ -23,7 +23,6 @@ services:
|
|||||||
|
|
||||||
erpnext-nginx:
|
erpnext-nginx:
|
||||||
image: frappe/erpnext-nginx:edge
|
image: frappe/erpnext-nginx:edge
|
||||||
restart: on-failure
|
|
||||||
environment:
|
environment:
|
||||||
- FRAPPE_PY=erpnext-python
|
- FRAPPE_PY=erpnext-python
|
||||||
- FRAPPE_PY_PORT=8000
|
- FRAPPE_PY_PORT=8000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user