Skip to content

Commit

Permalink
fix: add migrate for lab in before entry point (#179)
Browse files Browse the repository at this point in the history
* fix: add migrate for lab in before entry point
Co-authored-by: Patrick Tombez <[email protected]>
  • Loading branch information
vrenaville authored Feb 15, 2022
1 parent 92a43cc commit 7a18a12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ BASE_CMD=$(basename $1)
CMD_ARRAY=($*)
ARGS=(${CMD_ARRAY[@]:1})

if [ "$BASE_CMD" = "odoo" ] || [ "$BASE_CMD" = "odoo.py" ] ; then
if [ "$BASE_CMD" = "odoo" ] || [ "$BASE_CMD" = "odoo.py" ] || ([ "$BASE_CMD" = "gosu" ] && [ "${ARGS[@]}" = "odoo migrate" ] ); then

BEFORE_MIGRATE_ENTRYPOINT_DIR=/before-migrate-entrypoint.d
if [ -d "$BEFORE_MIGRATE_ENTRYPOINT_DIR" ]; then
run-parts --verbose "$BEFORE_MIGRATE_ENTRYPOINT_DIR"
fi
fi
if [ "$BASE_CMD" = "odoo" ] || [ "$BASE_CMD" = "odoo.py" ] ; then

# Bypass migrate when `odoo shell` or `odoo --help` are used
if [[ ! " ${ARGS[@]} " =~ " --help " ]] && [[ ! " ${ARGS[@]:0:1} " =~ " shell " ]]; then
Expand Down

0 comments on commit 7a18a12

Please sign in to comment.