From 212f18ff1c8a09384edb8988293624bc66aeee9e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 9 Apr 2022 02:29:20 +0200 Subject: [PATCH] [FIX] call pip install with -r and not -e; [IMP] adapt apt-get update call to old buggy images with '|| true' ; [IMP] install correctly openupgradelib on old images (https://github.com/OCA/openupgradelib/issues/248) --- .../configuration_version_dependant.py | 14 +++++++++++--- odoo_openupgrade_wizard/templates.py | 12 +++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/odoo_openupgrade_wizard/configuration_version_dependant.py b/odoo_openupgrade_wizard/configuration_version_dependant.py index 08b9fab..b3298d4 100644 --- a/odoo_openupgrade_wizard/configuration_version_dependant.py +++ b/odoo_openupgrade_wizard/configuration_version_dependant.py @@ -1,5 +1,13 @@ from pathlib import Path +# See : https://github.com/OCA/openupgradelib/issues/248 +# https://github.com/OCA/openupgradelib/issues/288 +_LEGACY_OPENUPGRADELIB = ( + "git+https://github.com/OCA/openupgradelib.git" + "@ed01555b8ae20f66b3af178c8ecaf6edd110ce75#egg=openupgradelib" +) + + # List of the series of odoo # python version is defined, based on the OCA CI. # https://github.com/OCA/oca-addons-repo-template/blob/master/src/.github/workflows/%7B%25%20if%20ci%20%3D%3D%20'GitHub'%20%25%7Dtest.yml%7B%25%20endif%20%25%7D.jinja @@ -7,17 +15,17 @@ _ODOO_VERSION_TEMPLATES = [ { "release": 8.0, "python_major_version": "python2", - "python_libraries": ["openupgradelib"], + "python_libraries": [_LEGACY_OPENUPGRADELIB], }, { "release": 9.0, "python_major_version": "python2", - "python_libraries": ["openupgradelib"], + "python_libraries": [_LEGACY_OPENUPGRADELIB], }, { "release": 10.0, "python_major_version": "python2", - "python_libraries": ["openupgradelib"], + "python_libraries": [_LEGACY_OPENUPGRADELIB], }, { "release": 11.0, diff --git a/odoo_openupgrade_wizard/templates.py b/odoo_openupgrade_wizard/templates.py index 193a140..534936c 100644 --- a/odoo_openupgrade_wizard/templates.py +++ b/odoo_openupgrade_wizard/templates.py @@ -65,10 +65,16 @@ PYTHON_REQUIREMENTS_TXT_TEMPLATE = """ {% endfor %} """ -DEBIAN_REQUIREMENTS_TXT_TEMPLATE = "" +DEBIAN_REQUIREMENTS_TXT_TEMPLATE = """ +git +""" ODOO_CONFIG_TEMPLATE = "" + +# Technical Notes: +# - We set apt-get update || true, because for some release (at least odoo:10) +# the command update fail, because of obsolete postgresql repository. DOCKERFILE_TEMPLATE = """ FROM odoo:{{ odoo_version['release'] }} MAINTAINER GRAP, Coop It Easy @@ -83,12 +89,12 @@ COPY debian_requirements.txt /debian_requirements.txt COPY python_requirements.txt /python_requirements.txt # 2. Install extra debian packages -RUN apt-get update &&\ +RUN apt-get update || true &&\ xargs apt-get install -y --no-install-recommends