From a04178f3be1d13c789db7cf95ea93a8f392ba31e Mon Sep 17 00:00:00 2001 From: Jose Zambudio Date: Thu, 4 Jul 2024 08:24:12 +0200 Subject: [PATCH] [ADD] test-requirements para AUTO_REQUIREMENTS --- 15.0.Dockerfile | 2 +- build.d/200-dependencies | 8 +++++++- build.sh | 5 +++++ lib/doodbalib/__init__.py | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 3714945e..b2d50003 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -2,7 +2,7 @@ FROM python:3.8-slim-bullseye AS base EXPOSE 8069 8072 -ARG TARGETARCH +ARG TARGETARCH=amd64 ARG GEOIP_UPDATER_VERSION=6.0.0 ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_AMD64_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' diff --git a/build.d/200-dependencies b/build.d/200-dependencies index 89f258a5..9b6aadf7 100755 --- a/build.d/200-dependencies +++ b/build.d/200-dependencies @@ -5,7 +5,9 @@ from glob import glob from os.path import basename, join, splitext -from doodbalib import AUTO_REQUIREMENTS, CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR +from doodbalib import ( + AGGREGATE, AUTO_REQUIREMENTS, CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR +) from doodbalib.installer import INSTALLERS, install, logger # Build dependencies installed before any others @@ -15,8 +17,12 @@ for name in INSTALLERS: req_files = [] if name == "pip" and AUTO_REQUIREMENTS: req_files += glob(join(SRC_DIR, "*", "requirements.txt")) + if not AGGREGATE: # devel case + req_files += glob(join(SRC_DIR, "*", "test-requirements.txt")) # Search also in subdirectories req_files += glob(join(SRC_DIR, "*", "*", "requirements.txt")) + if not AGGREGATE: # devel case + req_files += glob(join(SRC_DIR, "*", "*", "test-requirements.txt")) # Normal dependency installation req_files.append(join(CUSTOM_DIR, "dependencies", "%s.txt" % name)) for req_file in req_files: diff --git a/build.sh b/build.sh index 4418b4cb..22f98829 100755 --- a/build.sh +++ b/build.sh @@ -109,6 +109,11 @@ if [[ "${odoo}" != "" ]]; then -t dockermaster.aurestic.com/nubeaerp/odoo-base:${odoo}.0-onbuild \ -f ${odoo}.0.Dockerfile . + if [[ $? -ne 0 ]]; then + echo "Revisar error. Saliendo." + exit 1 + fi + if [[ ${github} -eq 1 ]]; then echo "[INFO] reTagging image to ghcr.io/aurestic/odoo-base:${odoo}.0-onbuild" docker tag \ diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 7d84e0f3..92494fc1 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -33,6 +33,7 @@ CLEAN = os.environ.get("CLEAN") == "true" AUTO_REQUIREMENTS = os.environ.get("AUTO_REQUIREMENTS") == "true" +AGGREGATE = os.environ.get("AGGREGATE") == "true" LOG_LEVELS = frozenset({"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}) FILE_APT_BUILD = os.path.join(CUSTOM_DIR, "dependencies", "apt_build.txt") PRIVATE = "private"