[IMP] make cli_05_execute_script_python_test working
This commit is contained in:
parent
b5419e5d19
commit
db3d16e37c
|
|
@ -1,6 +1,6 @@
|
||||||
FROM ghcr.io/acsone/odoo-bedrock:{{ odoo_version }}-{{python_minor_version_short}}-latest
|
FROM ghcr.io/acsone/odoo-bedrock:{{ odoo_version }}-{{python_minor_version_short}}-latest
|
||||||
|
|
||||||
COPY ./src/odoo/requirements.txt /odoo_requirements.txt
|
COPY ./src/odoo/ /odoo/src/odoo
|
||||||
COPY debian_requirements.txt /debian_requirements.txt
|
COPY debian_requirements.txt /debian_requirements.txt
|
||||||
COPY python_requirements.txt /python_requirements.txt
|
COPY python_requirements.txt /python_requirements.txt
|
||||||
|
|
||||||
|
|
@ -11,5 +11,6 @@ RUN apt-get update || true \
|
||||||
|
|
||||||
# 3. Install extra Python librairies
|
# 3. Install extra Python librairies
|
||||||
RUN \
|
RUN \
|
||||||
/odoo/bin/pip install --no-cache-dir -r /odoo_requirements.txt -f {{prebuild_wheel_url}} \
|
/odoo/bin/pip install --no-cache-dir -r /odoo/src/odoo/requirements.txt -f https://wheelhouse.acsone.eu/manylinux2014 \
|
||||||
&& /odoo/bin/pip install --no-cache-dir -r /python_requirements.txt -f {{prebuild_wheel_url}}
|
&& /odoo/bin/pip install --no-cache-dir -r /python_requirements.txt -f https://wheelhouse.acsone.eu/manylinux2014 \
|
||||||
|
&& /odoo/bin/pip install -e /odoo/src/odoo
|
||||||
|
|
|
||||||
|
|
@ -274,24 +274,11 @@ def execute_click_odoo_python_files(
|
||||||
]
|
]
|
||||||
python_files = sorted(python_files)
|
python_files = sorted(python_files)
|
||||||
|
|
||||||
# Prepare data information for docker
|
|
||||||
links = {ctx.obj["config"]["postgres_container_name"]: "db"}
|
|
||||||
env_path = ctx.obj["env_folder_path"]
|
|
||||||
odoo_env_path = get_odoo_env_path(ctx, migration_step["version"])
|
|
||||||
|
|
||||||
# Generate odoo config file
|
|
||||||
# log_file = "/env/log/{}____{}__post_migration.log".format(
|
|
||||||
# ctx.obj["log_prefix"], migration_step["complete_name"]
|
|
||||||
# )
|
|
||||||
|
|
||||||
for python_file in python_files:
|
for python_file in python_files:
|
||||||
# TODO, check if we should set python2 for old version of Odoo
|
# TODO, check if we should set python2 for old version of Odoo
|
||||||
# or just 'python'
|
# or just 'python'
|
||||||
command = (
|
command = (
|
||||||
"click-odoo"
|
"click-odoo" " --database {database}" " /env/{python_file}"
|
||||||
" --database {database}"
|
|
||||||
" --config /odoo_env/_auto_generated_odoo.cfg"
|
|
||||||
" /env/{python_file}"
|
|
||||||
).format(
|
).format(
|
||||||
database=database,
|
database=database,
|
||||||
python_file=str(python_file),
|
python_file=str(python_file),
|
||||||
|
|
@ -301,19 +288,14 @@ def execute_click_odoo_python_files(
|
||||||
"Executing script %s / %s"
|
"Executing script %s / %s"
|
||||||
% (migration_step["complete_name"], python_file)
|
% (migration_step["complete_name"], python_file)
|
||||||
)
|
)
|
||||||
run_container(
|
return run_container_odoo(
|
||||||
get_docker_image_tag(ctx, migration_step["version"]),
|
ctx,
|
||||||
get_docker_container_name(ctx, migration_step),
|
migration_step,
|
||||||
command=command,
|
command,
|
||||||
ports={},
|
detached_container=False,
|
||||||
volumes={
|
database=database,
|
||||||
env_path: "/env/",
|
|
||||||
odoo_env_path: "/odoo_env/",
|
|
||||||
},
|
|
||||||
links=links,
|
|
||||||
detach=False,
|
|
||||||
auto_remove=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user