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

:ambulance: fix addons path, add env var to allow it to be empty

parent 190c8761c22f
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
variables:
POSTGRES_USER: odoo
POSTGRES_HOST_AUTH_METHOD: trust
ODOO_ADDONS_PATH: ""
before_script:
- pip3 install $CI_PROJECT_DIR --disable-pip-version-check --no-cache-dir
script:
......@@ -22,7 +23,7 @@
before_script:
- pip3 install $CI_PROJECT_DIR --disable-pip-version-check --no-cache-dir
script:
- sudo -u odoo env ODOO_TYPE=odoo11 $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base --addons-path "" &
- sudo -u odoo env ODOO_TYPE=odoo11 $CI_PROJECT_DIR/start --db_host=db -d test_setup --max-cron-threads=0 --without-demo=all --data-dir /var/lib/odoo --init base &
# wait for odoo to install the modules
- sleep 35
# then test the setup files
......
......@@ -5,7 +5,8 @@
3.1
---
Add odoo 13
Add odoo 13.
Add ODOO_ADDONS_PATH env var to start.
3.0
---
......
......@@ -23,6 +23,7 @@
- ``odoo_type``: type of odoo (odoo7, odoo8, odoo10, odoo11 or odoo13) [default to odoo8]. The environment variable ODOO_TYPE can be used instead.
- ``modules``: list of directories and files to include (also used by another script)
The environment variable ODOO_ADDONS_PATH can be used to set the path for the addons, it can be empty if there is no path to include.
do_tests
--------
......
......@@ -120,5 +120,6 @@
then
addons_path=""
else
if [ "$ODOO_TYPE" = "odoo7" ] || [ "$ODOO_TYPE" = "odoo8" ];
# TODO ne pas faire ça si ODOO_ADDONS_PATH est mis à vide ou a une valeur
if [ -n "${ODOO_ADDONS_PATH+set}" ];
then
......@@ -124,3 +125,8 @@
then
pathes=$($python -B -c "from six.moves import configparser ; import os ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(['$odoo_addons_path/addons']+['${project_home}/'+line for line in set(os.path.dirname(path) for path in c.get('odoo_scripts', 'modules').split())]))")
if [ "$ODOO_TYPE" = "odoo7" ] || [ "$ODOO_TYPE" = "odoo8" ];
then
pathes=$($python -B -c "from six.moves import configparser ; import os ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(['$odoo_addons_path/addons']+['${project_home}/'+line for line in set(os.path.dirname(path) for path in c.get('odoo_scripts', 'modules').split())]))")
else
pathes=$($python -B -c "from six.moves import configparser ; import os ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(['${project_home}/'+line for line in set(os.path.dirname(path) for path in c.get('odoo_scripts', 'modules').split())]))")
fi
else
......@@ -126,5 +132,8 @@
else
pathes=$($python -B -c "from six.moves import configparser ; import os ; c = configparser.ConfigParser() ; c.read('${project_home}/setup.cfg') ; print(','.join(['${project_home}/'+line for line in set(os.path.dirname(path) for path in c.get('odoo_scripts', 'modules').split())]))")
if [ -n "${ODOO_ADDONS_PATH}" ];
then
pathes=$ODOO_ADDONS_PATH
fi
fi
if [ -n "$pathes" ];
then
......
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