[IMP] docker-build: errors if no odoo_requirements file

This commit is contained in:
Rémy Taymans 2022-10-13 14:34:09 +02:00
parent 30c0f1e61e
commit 5777d9004f

View File

@ -20,10 +20,27 @@ def docker_build(ctx, versions):
"""Build Odoo Docker Images and pull Postgres image"""
# Pull DB image
logger.info(
"Pulling the postgresql docker image. This can take a while..."
)
pull_image(ctx.obj["config"]["postgres_image_name"])
# Build images for each odoo version
for odoo_version in get_odoo_versions_from_options(ctx, versions):
odoo_requirement_file_path = (
get_odoo_env_path(ctx, odoo_version) / "src/odoo/requirements.txt"
)
if not odoo_requirement_file_path.exists():
logger.error(
"Building Odoo docker image for version {odoo_version}, "
"because file {odoo_requirement_file_path} cannot be found. "
"Have your run the get-code command ?",
odoo_version=odoo_version,
odoo_requirement_file_path=odoo_requirement_file_path,
)
continue
logger.info(
"Building Odoo docker image for version '%s'. "
"This can take a while..." % (odoo_version)