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
70cd203782b4
Commit
70cd203782b4
authored
6 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
reorder imports, do not check version parts
parent
4b0f68b9216b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker_dev_start.py
+14
-19
14 additions, 19 deletions
docker_dev_start.py
with
14 additions
and
19 deletions
docker_dev_start.py
+
14
−
19
View file @
70cd2037
...
...
@@ -5,7 +5,8 @@
"""
import
argparse
import
logging
import
os
import
pwd
import
signal
from
subprocess
import
call
import
sys
...
...
@@ -8,8 +9,7 @@
import
pwd
import
signal
from
subprocess
import
call
import
sys
import
os
import
ConfigParser
...
...
@@ -26,5 +26,5 @@
_logger
=
logging
.
getLogger
(
__name__
)
__version__
=
'
0.1.
0
'
__version__
=
'
0.1.
1
'
__date__
=
'
2017-08-11
'
...
...
@@ -30,11 +30,5 @@
__date__
=
'
2017-08-11
'
__updated__
=
'
2017-09-07
'
# Check the version of the "docker" package
if
docker
.
__version__
.
split
(
'
.
'
)
<
[
2
]:
print
(
"
the version of the docker package is {} instead of 1.9
"
.
format
(
docker
.
__version__
))
sys
.
exit
(
1
)
__updated__
=
'
2018-04-04
'
def
which
(
program
):
...
...
@@ -82,6 +76,5 @@
USAGE
'''
%
(
program_shortdesc
,
str
(
__date__
))
# TODO the script assume it is launched from the parent super project
project_path
=
os
.
path
.
realpath
(
'
.
'
)
project_name
=
os
.
path
.
basename
(
project_path
)
...
...
@@ -86,5 +79,11 @@
project_path
=
os
.
path
.
realpath
(
'
.
'
)
project_name
=
os
.
path
.
basename
(
project_path
)
if
project_name
==
'
odoo_scripts
'
:
logging
.
fatal
(
"
You must run this script from the super project
"
"
(./odoo_scripts/docker_dev_start.py)
"
)
return
setup_path
=
'
setup.cfg
'
# TODO add a way to store configuration options in a project file
# Argument parsing
...
...
@@ -210,12 +209,6 @@
start_postgresql
=
nmspc
.
start_postgresql
no_flake8
=
nmspc
.
no_flake8
if
project_name
==
'
odoo_scripts
'
:
logging
.
fatal
(
"
You must run this script from the super project
"
"
(./odoo_scripts/docker_dev_start.py)
"
)
return
c
=
ConfigParser
.
ConfigParser
()
logging
.
debug
(
'
setup file path %s
'
,
setup_path
)
# TODO test that setup file exists
...
...
@@ -249,7 +242,7 @@
docker_client
=
docker_api
(
base_url
=
'
unix://var/run/docker.sock
'
)
image_list
=
docker_client
.
images
(
name
=
image
,
quiet
=
True
)
if
not
image_list
:
logging
.
warn
(
"
Image %s does not exist
"
,
image
)
logging
.
warn
ing
(
"
Image %s does not exist
"
,
image
)
else
:
logging
.
info
(
"
Test image found
"
)
...
...
@@ -501,7 +494,7 @@
logging
.
info
(
'
Running flake8
'
)
call
([
'
flake8
'
])
else
:
logging
.
warn
(
'
No flake8 in PATH
'
)
logging
.
warn
ing
(
'
No flake8 in PATH
'
)
if
start_postgresql
:
# use docker-py to be able to stop both the database and odoo
...
...
@@ -560,4 +553,5 @@
cmd
.
extend
(
options
)
cmd
.
append
(
image
)
cmd
.
extend
(
arg
)
cmd
.
append
(
'
--dev=reload
'
)
logging
.
debug
(
'
'
.
join
(
cmd
))
...
...
@@ -563,5 +557,6 @@
logging
.
debug
(
'
'
.
join
(
cmd
))
call
(
cmd
)
result
=
call
(
cmd
)
return
result
def
createVolume
(
docker_client
,
data_volume_name
):
...
...
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