feat: auto migrate on container start if AUTO_MIGRATE set

This commit is contained in:
Revant Nandgaonkar
2020-03-21 15:47:35 +05:30
parent 7c356ccb27
commit 674c766480
4 changed files with 116 additions and 0 deletions

View File

@@ -76,6 +76,10 @@ if [ "$1" = 'start' ]; then
export FRAPPE_PORT=8000
fi
if [[ ! -z "$AUTO_MIGRATE" ]]; then
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
&& python /home/frappe/frappe-bench/commands/auto_migrate.py"
fi
if [[ -z "$RUN_AS_ROOT" ]]; then
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \