Skip to content
Snippets Groups Projects
Commit 4c899b7e0389 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:books: update readme

parent 03eebf201ccf
No related branches found
No related tags found
No related merge requests found
...@@ -10,5 +10,8 @@ ...@@ -10,5 +10,8 @@
Its arguments are forwarded to the Odoo executable (``odoo-bin`` / ``openerp-server``). Its arguments are forwarded to the Odoo executable (``odoo-bin`` / ``openerp-server``).
It expect the configuration file (`setup.cfg`) to have the following keys: It expect the configuration file (`setup.cfg`_) to have the following keys:
- ``odoo_type``: type of odoo (bzr, odoo7, odoo8 or odoo10) [default to odoo8]
- ``addon_dirs``: local directories of odoo modules to also use (on top of those shipped with odoo)
...@@ -14,6 +17,8 @@ ...@@ -14,6 +17,8 @@
- `odoo_type`: type of odoo (bzr, odoo7, odoo8 or odoo10) [default to odoo8] do_tests.py
- `addon_dirs`: local directories of odoo modules to also use (on top of those shipped with odoo) -----------
This scripts launches the tests, but with more options than `do_tests`_. It uses docker by default, similar to `docker_dev_start.py`_.
do_tests do_tests
-------- --------
...@@ -23,5 +28,5 @@ ...@@ -23,5 +28,5 @@
It need to be run on a machine with all the odoo requirements installed, either system-wide or in a virtual environment (which need to be activated). It need to be run on a machine with all the odoo requirements installed, either system-wide or in a virtual environment (which need to be activated).
A postgresql server is also needed. A postgresql server is also needed.
It takes two optionnal arguments, the host of the postgresql server, and the user for this base (which need database creation rights). If a user is provided, you will need to have a .pgpass with the password if it is not the one in ``conf/dev/odoo.conf``. It takes two optional arguments, the host of the postgresql server, and the user for this base (which need database creation rights). If a user is provided, you will need to have a .pgpass with the password if it is not the one in ``conf/dev/odoo.conf``.
...@@ -27,3 +32,3 @@ ...@@ -27,3 +32,3 @@
The script call ``run_tests``. The script call `run_tests`_.
...@@ -29,3 +34,3 @@ ...@@ -29,3 +34,3 @@
It expect the configuration file (`setup.cfg`) to have the following keys: It expect the configuration file (`setup.cfg`_) to have the following keys:
...@@ -31,6 +36,6 @@ ...@@ -31,6 +36,6 @@
- `module_list`: list (separated by white space) of odoo modules to install on the database (default to empty list) - ``module_list``: list (separated by white space) of odoo modules to install on the database (default to empty list)
- `unaccent`: boolean to indicate if unaccent is to be installed on the database (default to True) - ``unaccent``: boolean to indicate if unaccent is to be installed on the database (default to True)
run_tests run_tests
--------- ---------
...@@ -42,5 +47,5 @@ ...@@ -42,5 +47,5 @@
The name of the database is the same as do_tests or can be provided. The name of the database is the same as do_tests or can be provided.
The script call ``start``. The script call `start`_.
...@@ -46,3 +51,3 @@ ...@@ -46,3 +51,3 @@
It expect the configuration file (`setup.cfg`) to have the following keys: It expect the configuration file (`setup.cfg`_) to have the following keys:
...@@ -48,7 +53,7 @@ ...@@ -48,7 +53,7 @@
- `module_list_tests`: list (separated by white space) of odoo modules to run tests for on the database (default to empty list) - ``module_list_tests``: list (separated by white space) of odoo modules to run tests for on the database (default to empty list)
- `odoo_type`: type of odoo (bzr, odoo7, odoo8 or odoo10) [default to odoo8] - ``odoo_type``: type of odoo (bzr, odoo7, odoo8 or odoo10) [default to odoo8]
conf2reST.py conf2reST.py
------------ ------------
...@@ -51,8 +56,8 @@ ...@@ -51,8 +56,8 @@
conf2reST.py conf2reST.py
------------ ------------
This script is used to produce a reST file from setup.cfg, the Dockerfile and the .hgconf/nest.yaml file. This script is used to produce a reST file from setup.cfg, the Dockerfile and the ``.hgconf``/``nest.yaml`` file.
create_archive create_archive
-------------- --------------
...@@ -64,5 +69,5 @@ ...@@ -64,5 +69,5 @@
This script will update a metaproject that only contain the sources of the one it is launched from. This script will update a metaproject that only contain the sources of the one it is launched from.
It expect the configuration file (`setup.cfg`) to have the following keys: It expect the configuration file (`setup.cfg`_) to have the following keys:
...@@ -68,7 +73,7 @@ ...@@ -68,7 +73,7 @@
- `modules`: list of directories and files to include (also used by another script) - ``modules``: list of directories and files to include (also used by another script)
- `dependencies`: list of directories and files to include (also used by another script) - ``dependencies``: list of directories and files to include (also used by another script)
- `other_sources`: list of directories and files to include (only used by this script, used for README, ReleaseNotes, script directories, etc.) - ``other_sources``: list of directories and files to include (only used by this script, used for README, ReleaseNotes, script directories, etc.)
No change are made to the name of the directories/files included. No change are made to the name of the directories/files included.
...@@ -72,8 +77,8 @@ ...@@ -72,8 +77,8 @@
No change are made to the name of the directories/files included. No change are made to the name of the directories/files included.
docker_dev_start docker_dev_start.py
---------------- -------------------
This script can be used to start an odoo from a docker but with the local addons modules mounted. This script can be used to start an odoo from a docker but with the local addons modules mounted.
...@@ -85,3 +90,21 @@ ...@@ -85,3 +90,21 @@
apt install python-docker python-psycopg2 python-requests apt install python-docker python-psycopg2 python-requests
docker_build.py
---------------
This script builds a docker image of the project.
It uses the super project’s `setup.cfg`_ and ``Dockerfile``.
setup.cfg
---------
The scripts expects configuration in the odoo_scripts section of ``setup.cfg``. This file is in the super project, not the one in ``odoo_scripts``.
Configuration keys:
modules
list of modules to install (relative to project directory), those modules are the ones copied in the Dockerfile
odoo_type
type of odoo (odoo7, odoo8, odoo10, odoo11)
2.16 2.17
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# #
# - access to pg database # - access to pg database
# #
# Version 2.16 # Version 2.17
here=$(dirname $0) here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD) project_home=$(cd $here && cd .. && echo $PWD)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# vim: set shiftwidth=4 softtabstop=4: # vim: set shiftwidth=4 softtabstop=4:
"""Script to run test with local modules """Script to run test with local modules
""" """
# Version 2.16 # Version 2.17
import argparse import argparse
import logging import logging
import os import os
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# vim: set shiftwidth=4 softtabstop=4: # vim: set shiftwidth=4 softtabstop=4:
"""Script to locally build a docker image """Script to locally build a docker image
""" """
# Version 2.16 # Version 2.17
import argparse import argparse
import json import json
import logging import logging
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"""Launch a docker image but bind the local directory inside the container """Launch a docker image but bind the local directory inside the container
and define the module path automatically. and define the module path automatically.
""" """
# Version 2.16 # Version 2.17
import argparse import argparse
import logging import logging
import os import os
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
action='store_false', action='store_false',
dest='dev', dest='dev',
) )
odoo_log_levels = ['info', 'warn', 'debug'] # TODO there are more odoo_log_levels = ['info', 'warn', 'debug', 'debug_sql'] # TODO there are more
parser.add_argument( parser.add_argument(
'--log-level', '--log-level',
help="Override odoo log level (for tests and install)", help="Override odoo log level (for tests and install)",
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
logging.debug('No data volume for this odoo version') logging.debug('No data volume for this odoo version')
# avoid the duplication of unbind volumes with all addons # avoid the duplication of unbind volumes with all addons
# additionnal_addons only in odoo < 11 # additionnal_addons only in odoo < 10
for extra_volume in ['additional_addons', 'var', 'data']: for extra_volume in ['additional_addons', 'var', 'data']:
volume_name = '{}_opt_odoo_{}'.format(project_name, extra_volume) volume_name = '{}_opt_odoo_{}'.format(project_name, extra_volume)
# volume = createVolume(docker_client, volume_name) # volume = createVolume(docker_client, volume_name)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
# Either provide the name of the database (first argument) or it will default to <project>_test # Either provide the name of the database (first argument) or it will default to <project>_test
# The DB user can be overriden by setting ODOO_SCRIPTS_DB_USER. # The DB user can be overriden by setting ODOO_SCRIPTS_DB_USER.
# Version 2.16 # Version 2.17
here=$(dirname $0) here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD) project_home=$(cd $here && cd .. && echo $PWD)
tested_modules=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print ','.join(c.get('odoo_scripts', 'module_list_tests', '').split())") tested_modules=$(python -B -c "import ConfigParser ; c = ConfigParser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print ','.join(c.get('odoo_scripts', 'module_list_tests', '').split())")
......
[bumpversion] [bumpversion]
current_version = 2.16 current_version = 2.17
parse = (?P<major>\d+)\.(?P<minor>\d+) parse = (?P<major>\d+)\.(?P<minor>\d+)
serialize = serialize =
{major}.{minor} {major}.{minor}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
# You can set ODOO_DATA_DIR and ODOO_DB_HOST if you want to avoid using the default value ($HOME/var/tmp and localhost) # You can set ODOO_DATA_DIR and ODOO_DB_HOST if you want to avoid using the default value ($HOME/var/tmp and localhost)
# #
# Version 2.16 # Version 2.17
here=$(dirname $0) here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD) project_home=$(cd $here && cd .. && echo $PWD)
python="/usr/bin/env python" python="/usr/bin/env python"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment