From 1a90a625d4b082f03df84ae268857824620f6443 Mon Sep 17 00:00:00 2001 From: Josh Santos Date: Sun, 31 Mar 2024 18:40:38 -0400 Subject: [PATCH] Update entrypoint to use new var Missed one change. --- 15.0/entrypoint.sh | 13 +++++++++++-- 16.0/entrypoint.sh | 13 +++++++++++-- 17.0/entrypoint.sh | 13 +++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/15.0/entrypoint.sh b/15.0/entrypoint.sh index f802bcb..ecb48fc 100755 --- a/15.0/entrypoint.sh +++ b/15.0/entrypoint.sh @@ -10,10 +10,13 @@ fi # and pass them as arguments to the odoo process if not present in the config file : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} +: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}} : ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} +: ${SEED:=${DB_ENV_SEED:=false}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" @@ -23,11 +26,17 @@ function check_config() { DB_ARGS+=("--${param}") DB_ARGS+=("${value}") } + +check_config "db_name" "$NAME" check_config "db_host" "$HOST" check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +if "$SEED" ; then + ODOO_ARGS+=("-i base") +fi + case "$1" in -- | odoo) shift @@ -35,12 +44,12 @@ case "$1" in exec odoo "$@" else wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" fi ;; -*) wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" ;; *) exec "$@" diff --git a/16.0/entrypoint.sh b/16.0/entrypoint.sh index f802bcb..ecb48fc 100755 --- a/16.0/entrypoint.sh +++ b/16.0/entrypoint.sh @@ -10,10 +10,13 @@ fi # and pass them as arguments to the odoo process if not present in the config file : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} +: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}} : ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} +: ${SEED:=${DB_ENV_SEED:=false}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" @@ -23,11 +26,17 @@ function check_config() { DB_ARGS+=("--${param}") DB_ARGS+=("${value}") } + +check_config "db_name" "$NAME" check_config "db_host" "$HOST" check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +if "$SEED" ; then + ODOO_ARGS+=("-i base") +fi + case "$1" in -- | odoo) shift @@ -35,12 +44,12 @@ case "$1" in exec odoo "$@" else wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" fi ;; -*) wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" ;; *) exec "$@" diff --git a/17.0/entrypoint.sh b/17.0/entrypoint.sh index f802bcb..ecb48fc 100755 --- a/17.0/entrypoint.sh +++ b/17.0/entrypoint.sh @@ -10,10 +10,13 @@ fi # and pass them as arguments to the odoo process if not present in the config file : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} +: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}} : ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} +: ${SEED:=${DB_ENV_SEED:=false}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" @@ -23,11 +26,17 @@ function check_config() { DB_ARGS+=("--${param}") DB_ARGS+=("${value}") } + +check_config "db_name" "$NAME" check_config "db_host" "$HOST" check_config "db_port" "$PORT" check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" +if "$SEED" ; then + ODOO_ARGS+=("-i base") +fi + case "$1" in -- | odoo) shift @@ -35,12 +44,12 @@ case "$1" in exec odoo "$@" else wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" fi ;; -*) wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}" ;; *) exec "$@"