File tree 3 files changed +31
-4
lines changed
3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 10
10
# and pass them as arguments to the odoo process if not present in the config file
11
11
: ${HOST:= ${DB_PORT_5432_TCP_ADDR:= ' db' } }
12
12
: ${PORT:= ${DB_PORT_5432_TCP_PORT:= 5432} }
13
+ : ${NAME:= ${DB_ENV_POSTGRES_NAME:= ${POSTGRES_NAME:= ' postgres' } } }
13
14
: ${USER:= ${DB_ENV_POSTGRES_USER:= ${POSTGRES_USER:= ' odoo' } } }
14
15
: ${PASSWORD:= ${DB_ENV_POSTGRES_PASSWORD:= ${POSTGRES_PASSWORD:= ' odoo' } } }
16
+ : ${SEED:= ${DB_ENV_SEED:= false} }
15
17
16
18
DB_ARGS=()
19
+ ODOO_ARGS=()
17
20
function check_config() {
18
21
param=" $1 "
19
22
value=" $2 "
@@ -23,19 +26,25 @@ function check_config() {
23
26
DB_ARGS+=(" --${param} " )
24
27
DB_ARGS+=(" ${value} " )
25
28
}
29
+
30
+ check_config " db_name" " $NAME "
26
31
check_config " db_host" " $HOST "
27
32
check_config " db_port" " $PORT "
28
33
check_config " db_user" " $USER "
29
34
check_config " db_password" " $PASSWORD "
30
35
36
+ if " $SEED " ; then
37
+ ODOO_ARGS+=(" -i base" )
38
+ fi
39
+
31
40
case " $1 " in
32
41
-- | odoo)
33
42
shift
34
43
if [[ " $1 " == " scaffold" ]] ; then
35
44
exec odoo " $@ "
36
45
else
37
46
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38
- exec odoo " $@ " " ${DB_ARGS[@]} "
47
+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
39
48
fi
40
49
;;
41
50
-* )
Original file line number Diff line number Diff line change 10
10
# and pass them as arguments to the odoo process if not present in the config file
11
11
: ${HOST:= ${DB_PORT_5432_TCP_ADDR:= ' db' } }
12
12
: ${PORT:= ${DB_PORT_5432_TCP_PORT:= 5432} }
13
+ : ${NAME:= ${DB_ENV_POSTGRES_NAME:= ${POSTGRES_NAME:= ' postgres' } } }
13
14
: ${USER:= ${DB_ENV_POSTGRES_USER:= ${POSTGRES_USER:= ' odoo' } } }
14
15
: ${PASSWORD:= ${DB_ENV_POSTGRES_PASSWORD:= ${POSTGRES_PASSWORD:= ' odoo' } } }
16
+ : ${SEED:= ${DB_ENV_SEED:= false} }
15
17
16
18
DB_ARGS=()
19
+ ODOO_ARGS=()
17
20
function check_config() {
18
21
param=" $1 "
19
22
value=" $2 "
@@ -23,19 +26,25 @@ function check_config() {
23
26
DB_ARGS+=(" --${param} " )
24
27
DB_ARGS+=(" ${value} " )
25
28
}
29
+
30
+ check_config " db_name" " $NAME "
26
31
check_config " db_host" " $HOST "
27
32
check_config " db_port" " $PORT "
28
33
check_config " db_user" " $USER "
29
34
check_config " db_password" " $PASSWORD "
30
35
36
+ if " $SEED " ; then
37
+ ODOO_ARGS+=(" -i base" )
38
+ fi
39
+
31
40
case " $1 " in
32
41
-- | odoo)
33
42
shift
34
43
if [[ " $1 " == " scaffold" ]] ; then
35
44
exec odoo " $@ "
36
45
else
37
46
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38
- exec odoo " $@ " " ${DB_ARGS[@]} "
47
+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
39
48
fi
40
49
;;
41
50
-* )
Original file line number Diff line number Diff line change 10
10
# and pass them as arguments to the odoo process if not present in the config file
11
11
: ${HOST:= ${DB_PORT_5432_TCP_ADDR:= ' db' } }
12
12
: ${PORT:= ${DB_PORT_5432_TCP_PORT:= 5432} }
13
+ : ${NAME:= ${DB_ENV_POSTGRES_NAME:= ${POSTGRES_NAME:= ' postgres' } } }
13
14
: ${USER:= ${DB_ENV_POSTGRES_USER:= ${POSTGRES_USER:= ' odoo' } } }
14
15
: ${PASSWORD:= ${DB_ENV_POSTGRES_PASSWORD:= ${POSTGRES_PASSWORD:= ' odoo' } } }
16
+ : ${SEED:= ${DB_ENV_SEED:= false} }
15
17
16
18
DB_ARGS=()
19
+ ODOO_ARGS=()
17
20
function check_config() {
18
21
param=" $1 "
19
22
value=" $2 "
@@ -23,19 +26,25 @@ function check_config() {
23
26
DB_ARGS+=(" --${param} " )
24
27
DB_ARGS+=(" ${value} " )
25
28
}
29
+
30
+ check_config " db_name" " $NAME "
26
31
check_config " db_host" " $HOST "
27
32
check_config " db_port" " $PORT "
28
33
check_config " db_user" " $USER "
29
34
check_config " db_password" " $PASSWORD "
30
35
36
+ if " $SEED " ; then
37
+ ODOO_ARGS+=(" -i base" )
38
+ fi
39
+
31
40
case " $1 " in
32
41
-- | odoo)
33
42
shift
34
43
if [[ " $1 " == " scaffold" ]] ; then
35
44
exec odoo " $@ "
36
45
else
37
46
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
38
- exec odoo " $@ " " ${DB_ARGS[@]} "
47
+ exec odoo " $@ " " ${DB_ARGS[@]} " " ${ODOO_ARGS[@]} "
39
48
fi
40
49
;;
41
50
-* )
@@ -46,4 +55,4 @@ case "$1" in
46
55
exec " $@ "
47
56
esac
48
57
49
- exit 1
58
+ exit 1
You can’t perform that action at this time.
0 commit comments