File tree Expand file tree Collapse file tree 3 files changed +33
-6
lines changed Expand file tree Collapse file tree 3 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 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
1618DB_ARGS=()
19+ ODOO_ARGS=()
1720function check_config() {
1821 param=" $1 "
1922 value=" $2 "
@@ -23,24 +26,30 @@ function check_config() {
2326 DB_ARGS+=(" --${param} " )
2427 DB_ARGS+=(" ${value} " )
2528}
29+
30+ check_config " db_name" " $NAME "
2631check_config " db_host" " $HOST "
2732check_config " db_port" " $PORT "
2833check_config " db_user" " $USER "
2934check_config " db_password" " $PASSWORD "
3035
36+ if " $SEED " ; then
37+ ODOO_ARGS+=(" -i base" )
38+ fi
39+
3140case " $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 -* )
4251 wait-for-psql.py ${DB_ARGS[@]} --timeout=30
43- exec odoo " $@ " " ${DB_ARGS[@]} "
52+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
4453 ;;
4554 * )
4655 exec " $@ "
Original file line number Diff line number Diff line change 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
1618DB_ARGS=()
19+ ODOO_ARGS=()
1720function check_config() {
1821 param=" $1 "
1922 value=" $2 "
@@ -23,24 +26,30 @@ function check_config() {
2326 DB_ARGS+=(" --${param} " )
2427 DB_ARGS+=(" ${value} " )
2528}
29+
30+ check_config " db_name" " $NAME "
2631check_config " db_host" " $HOST "
2732check_config " db_port" " $PORT "
2833check_config " db_user" " $USER "
2934check_config " db_password" " $PASSWORD "
3035
36+ if " $SEED " ; then
37+ ODOO_ARGS+=(" -i base" )
38+ fi
39+
3140case " $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 -* )
4251 wait-for-psql.py ${DB_ARGS[@]} --timeout=30
43- exec odoo " $@ " " ${DB_ARGS[@]} "
52+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
4453 ;;
4554 * )
4655 exec " $@ "
Original file line number Diff line number Diff line change 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
1618DB_ARGS=()
19+ ODOO_ARGS=()
1720function check_config() {
1821 param=" $1 "
1922 value=" $2 "
@@ -23,24 +26,30 @@ function check_config() {
2326 DB_ARGS+=(" --${param} " )
2427 DB_ARGS+=(" ${value} " )
2528}
29+
30+ check_config " db_name" " $NAME "
2631check_config " db_host" " $HOST "
2732check_config " db_port" " $PORT "
2833check_config " db_user" " $USER "
2934check_config " db_password" " $PASSWORD "
3035
36+ if " $SEED " ; then
37+ ODOO_ARGS+=(" -i base" )
38+ fi
39+
3140case " $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 -* )
4251 wait-for-psql.py ${DB_ARGS[@]} --timeout=30
43- exec odoo " $@ " " ${DB_ARGS[@]} "
52+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
4453 ;;
4554 * )
4655 exec " $@ "
You can’t perform that action at this time.
0 commit comments