forked from mpanarin/.dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodoo_aliases
123 lines (113 loc) · 2.75 KB
/
odoo_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
alias doco_templatedb='doco run --rm odoo createdb -T odoodb'
alias doco_dropdb='doco run --rm odoo dropdb'
function doco_run() {
if [ -z "$1" ]
then
db=odoodb
else
db=$1
fi
if [ -z "$2" ]
then
port=80
else
port=$2
fi
doco run --rm -e DB_NAME=$db -p $port:8069 odoo odoo --workers=0
}
function doco_run_dev() {
if [ -z "$1" ]
then
db=odoodb
else
db=$1
fi
if [ -z "$2" ]
then
port=80
else
port=$1
fi
doco run --rm -e DB_NAME=$db -p $port:8069 odoo odoo --workers=0 --dev=qweb,xml
}
function doco_old_run() {
if [ -z "$1" ]
then
db=odoodb
else
db=$1
fi
if [ -z "$2" ]
then
port=80
else
port=$2
fi
doco run --rm -e DB_NAME=$db -p $port:8069 odoo odoo --workers=0 --dev
}
function doco_migrate() {
if [ -z "$1" ]
then
return "no db name provided"
else
db=$1
fi
if [ -z "$2" ]
then
return "no version specified"
else
version=$2
fi
doco run --rm -e MARABUNTA_FORCE_VERSION=$version -e DB_NAME=$db odoo migrate
}
function doco_sh() {
if [ -z "$1" ]
then
db=odoodb
else
db=$1
fi
doco run --rm -e DB_NAME=$db odoo odoo shell
}
function doco_ant() {
if [ -z "$1" ]
then
echo "no db name"
else
doco run --rm -e DB_NAME=$1 odoo anthem $2
fi
}
function doco_psql() {
if [ -z "$1" ]
then
echo "no container name"
else
docker exec -it $1 psql -U odoo
fi
}
function doco_bash() {
if [ -z "$1" ]
then
echo "no container name"
else
docker exec -it $1 bash
fi
}
# setup test database. Just run `dood_test_setup`
alias dood_test_setup='docker-compose run --rm -e DB_NAME=testdb odoo testdb-gen -i base'
# reuse testdb and install or update modules on demand. Just run `dood_test_update -i/u something`
alias dood_test_update='docker-compose run --rm -e DB_NAME=testdb odoo testdb-update'
# run tests using pytest. Just run `dood_test_run path/to/your/module`
# NOTE: you need to run dood_test_update 1st IF xml or models have been updated
alias dood_test_run='docker-compose run --rm -e DB_NAME=testdb odoo pytest -s'
# run tests using std odoo test machinery (eg: you need an HttpCase). Just run `dood_test_run_odoo -u module`
alias dood_test_run_odoo='docker-compose run --rm -e DEMO=True -e DB_NAME=testdb -e MIGRATE=False odoo odoo --workers=0 --test-enable --stop-after-init'
function dood_test_with_cov() {
if [ -z "$1" ]
then
echo 'no module path'
else
doco run --rm -e DB_NAME=testdb odoo pytest -s $1 --cov=$1
fi
}
alias dood_test_run_travis='docker-compose run --rm odoo runtests'