Skip to content

Commit fb45459

Browse files
committed
Update entrypoint to use new var
1 parent 5740583 commit fb45459

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

15.0/entrypoint.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ fi
1010
# and pass them as arguments to the odoo process if not present in the config file
1111
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
1212
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
13+
: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}}
1314
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
1415
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
16+
: ${SEED:=${DB_ENV_SEED:=false}}
1517

1618
DB_ARGS=()
19+
ODOO_ARGS=()
1720
function check_config() {
1821
param="$1"
1922
value="$2"
@@ -23,19 +26,25 @@ function check_config() {
2326
DB_ARGS+=("--${param}")
2427
DB_ARGS+=("${value}")
2528
}
29+
30+
check_config "db_name" "$NAME"
2631
check_config "db_host" "$HOST"
2732
check_config "db_port" "$PORT"
2833
check_config "db_user" "$USER"
2934
check_config "db_password" "$PASSWORD"
3035

36+
if "$SEED" ; then
37+
ODOO_ARGS+=("-i base")
38+
fi
39+
3140
case "$1" in
3241
-- | odoo)
3342
shift
3443
if [[ "$1" == "scaffold" ]] ; then
3544
exec odoo "$@"
3645
else
3746
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38-
exec odoo "$@" "${DB_ARGS[@]}"
47+
exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}"
3948
fi
4049
;;
4150
-*)

16.0/entrypoint.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ fi
1010
# and pass them as arguments to the odoo process if not present in the config file
1111
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
1212
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
13+
: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}}
1314
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
1415
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
16+
: ${SEED:=${DB_ENV_SEED:=false}}
1517

1618
DB_ARGS=()
19+
ODOO_ARGS=()
1720
function check_config() {
1821
param="$1"
1922
value="$2"
@@ -23,19 +26,25 @@ function check_config() {
2326
DB_ARGS+=("--${param}")
2427
DB_ARGS+=("${value}")
2528
}
29+
30+
check_config "db_name" "$NAME"
2631
check_config "db_host" "$HOST"
2732
check_config "db_port" "$PORT"
2833
check_config "db_user" "$USER"
2934
check_config "db_password" "$PASSWORD"
3035

36+
if "$SEED" ; then
37+
ODOO_ARGS+=("-i base")
38+
fi
39+
3140
case "$1" in
3241
-- | odoo)
3342
shift
3443
if [[ "$1" == "scaffold" ]] ; then
3544
exec odoo "$@"
3645
else
3746
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38-
exec odoo "$@" "${DB_ARGS[@]}"
47+
exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}"
3948
fi
4049
;;
4150
-*)

17.0/entrypoint.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ fi
1010
# and pass them as arguments to the odoo process if not present in the config file
1111
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
1212
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
13+
: ${NAME:=${DB_ENV_POSTGRES_NAME:=${POSTGRES_NAME:='postgres'}}}
1314
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
1415
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
16+
: ${SEED:=${DB_ENV_SEED:=false}}
1517

1618
DB_ARGS=()
19+
ODOO_ARGS=()
1720
function check_config() {
1821
param="$1"
1922
value="$2"
@@ -23,19 +26,25 @@ function check_config() {
2326
DB_ARGS+=("--${param}")
2427
DB_ARGS+=("${value}")
2528
}
29+
30+
check_config "db_name" "$NAME"
2631
check_config "db_host" "$HOST"
2732
check_config "db_port" "$PORT"
2833
check_config "db_user" "$USER"
2934
check_config "db_password" "$PASSWORD"
3035

36+
if "$SEED" ; then
37+
ODOO_ARGS+=("-i base")
38+
fi
39+
3140
case "$1" in
3241
-- | odoo)
3342
shift
3443
if [[ "$1" == "scaffold" ]] ; then
3544
exec odoo "$@"
3645
else
3746
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38-
exec odoo "$@" "${DB_ARGS[@]}"
47+
exec odoo "$@" "${DB_ARGS[@]}" "${ODOO_ARGS[@]}"
3948
fi
4049
;;
4150
-*)
@@ -46,4 +55,4 @@ case "$1" in
4655
exec "$@"
4756
esac
4857

49-
exit 1
58+
exit 1

0 commit comments

Comments
 (0)