Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
4f0257e9564c
Commit
4f0257e9564c
authored
5 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
handle odoo 7 mount points better to keep sessions
also cleaned up handling mount points
parent
07c327d902e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker_dev_start.py
+40
-19
40 additions, 19 deletions
docker_dev_start.py
with
40 additions
and
19 deletions
docker_dev_start.py
+
40
−
19
View file @
4f0257e9
...
...
@@ -514,15 +514,21 @@
password
=
'
odoo
'
# data volume handling
if
odoo_type
!=
'
odoo7
'
:
data_volume_name
=
'
{}_data
'
.
format
(
project_name
)
_logger
.
debug
(
'
Using data volume %s
'
,
data_volume_name
)
createVolume
(
docker_client
,
data_volume_name
)
# make sure the permission in the volume are correct
mount_opts
=
'
{}:/mnt/data
'
.
format
(
data_volume_name
)
# TODO replace by something cleaner if possible
call
([
'
docker
'
,
'
run
'
,
'
--rm
'
,
'
-v
'
,
mount_opts
,
'
busybox
'
,
'
chmod
'
,
'
-R
'
,
'
777
'
,
'
/mnt/data
'
,
])
if
odoo_type
==
'
odoo7
'
:
_logger
.
debug
(
'
Only sessions volume for this odoo version
'
)
# this path is in odoo code, the last part is the system user
data_volume_path
=
'
/tmp/oe-sessions-{}
'
.
format
(
'
odoo
'
)
else
:
data_volume_path
=
'
/mnt/data
'
arg
.
append
(
'
--data-dir {}
'
.
format
(
data_volume_path
))
data_volume_name
=
'
{}_data
'
.
format
(
project_name
)
_logger
.
debug
(
'
Using data volume %s
'
,
data_volume_name
)
createVolume
(
docker_client
,
data_volume_name
)
# make sure the permission in the volume are correct
mount_opts
=
'
{}:/mnt
'
.
format
(
data_volume_name
)
# TODO replace by something cleaner if possible
call
([
'
docker
'
,
'
run
'
,
'
--rm
'
,
'
-v
'
,
mount_opts
,
'
--entrypoint
'
,
'
/bin/chown
'
,
image
,
'
odoo
'
,
'
/mnt
'
,
])
...
...
@@ -528,7 +534,4 @@
binds
.
append
(
'
{}:/mnt/data
'
.
format
(
data_volume_name
))
arg
.
append
(
'
--data-dir /mnt/data
'
)
else
:
_logger
.
debug
(
'
No data volume for this odoo version
'
)
binds
.
append
(
'
{}:{}
'
.
format
(
data_volume_name
,
data_volume_path
))
# avoid the duplication of unbind volumes with all addons
...
...
@@ -533,6 +536,24 @@
# avoid the duplication of unbind volumes with all addons
# additionnal_addons only in odoo < 10
for
extra_volume
in
[
'
additional_addons
'
,
'
var
'
,
'
data
'
]:
volume_name
=
'
{}_opt_odoo_{}
'
.
format
(
project_name
,
extra_volume
)
if
odoo_type
==
'
odoo7
'
:
extra_volumes
=
[
'
/opt/odoo/additional_addons
'
,
'
/opt/odoo/var
'
,
# not used but declared as a mount point in Dockerfile :-(
'
/opt/odoo/data
'
,
]
elif
odoo_type
==
'
odoo8
'
:
extra_volumes
=
[
'
/opt/odoo/additional_addons
'
,
'
/opt/odoo/var
'
,
'
/opt/odoo/data
'
,
]
elif
odoo_type
==
'
odoo10
'
:
extra_volumes
=
[
'
/opt/odoo/additional_addons
'
,
'
/opt/odoo/var
'
,
'
/opt/odoo/data
'
,
]
else
:
extra_volumes
=
[
'
/var/lib/odoo
'
,
]
for
extra_volume
in
extra_volumes
:
volume_name
=
'
{}_{}
'
.
format
(
project_name
,
extra_volume
.
replace
(
'
/
'
,
'
_
'
))
# volume = createVolume(docker_client, volume_name)
...
...
@@ -538,5 +559,5 @@
# volume = createVolume(docker_client, volume_name)
binds
.
append
(
'
{}:
/opt/odoo/
{}
'
.
format
(
volume_name
,
extra_volume
))
binds
.
append
(
'
{}:{}
'
.
format
(
volume_name
,
extra_volume
))
start_py3o_stack
=
'
report_py3o_fusion_server
'
in
module_list
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment