[IMP] make modular port on host. default with 9069 and 9432 to avoid conflict on host that regularly expose 8069 and 5432
This commit is contained in:
parent
a21462e2e6
commit
6b1ffa2a8c
|
|
@ -38,6 +38,6 @@ pytest:
|
||||||
- poetry run pytest --version
|
- poetry run pytest --version
|
||||||
|
|
||||||
# Create a postgresql container
|
# Create a postgresql container
|
||||||
- docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:13
|
- docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --publish 9542:5432 --name db postgres:13
|
||||||
|
|
||||||
- poetry run pytest --cov odoo_openupgrade_wizard -v
|
- poetry run pytest --cov odoo_openupgrade_wizard -v
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ from odoo_openupgrade_wizard.cli_docker_build import docker_build
|
||||||
from odoo_openupgrade_wizard.cli_get_code import get_code
|
from odoo_openupgrade_wizard.cli_get_code import get_code
|
||||||
from odoo_openupgrade_wizard.cli_init import init
|
from odoo_openupgrade_wizard.cli_init import init
|
||||||
from odoo_openupgrade_wizard.cli_run import run
|
from odoo_openupgrade_wizard.cli_run import run
|
||||||
|
from odoo_openupgrade_wizard.cli_test import test
|
||||||
from odoo_openupgrade_wizard.cli_upgrade import upgrade
|
from odoo_openupgrade_wizard.cli_upgrade import upgrade
|
||||||
from odoo_openupgrade_wizard.tools_system import ensure_folder_exists
|
from odoo_openupgrade_wizard.tools_system import ensure_folder_exists
|
||||||
|
|
||||||
|
|
@ -96,3 +97,4 @@ main.add_command(get_code)
|
||||||
main.add_command(docker_build)
|
main.add_command(docker_build)
|
||||||
main.add_command(run)
|
main.add_command(run)
|
||||||
main.add_command(upgrade)
|
main.add_command(upgrade)
|
||||||
|
main.add_command(test)
|
||||||
|
|
|
||||||
17
odoo_openupgrade_wizard/cli_test.py
Normal file
17
odoo_openupgrade_wizard/cli_test.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import click
|
||||||
|
import docker
|
||||||
|
import dockerpty
|
||||||
|
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.pass_context
|
||||||
|
def test(ctx):
|
||||||
|
client = docker.Client()
|
||||||
|
container = client.create_container(
|
||||||
|
image="busybox:latest",
|
||||||
|
stdin_open=True,
|
||||||
|
tty=True,
|
||||||
|
command="/bin/sh",
|
||||||
|
)
|
||||||
|
|
||||||
|
dockerpty.start(client, container)
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
CONFIG_YML_TEMPLATE = """project_name: {{ project_name }}
|
CONFIG_YML_TEMPLATE = """project_name: {{ project_name }}
|
||||||
|
|
||||||
host_odoo_xmlrpc_port: 8069
|
host_odoo_xmlrpc_port: 9069
|
||||||
|
host_postgres_port: 9432
|
||||||
|
|
||||||
odoo_versions:
|
odoo_versions:
|
||||||
{% for odoo_version in odoo_versions %}
|
{% for odoo_version in odoo_versions %}
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,10 @@ def run_odoo(
|
||||||
get_docker_image_tag(ctx, odoo_version),
|
get_docker_image_tag(ctx, odoo_version),
|
||||||
get_docker_container_name(ctx, migration_step),
|
get_docker_container_name(ctx, migration_step),
|
||||||
command=command,
|
command=command,
|
||||||
ports={"8069": 8069, "5432": 5432},
|
ports={
|
||||||
|
"8069": ctx.obj["config"]["host_odoo_xmlrpc_port"],
|
||||||
|
"5432": ctx.obj["config"]["host_postgres_port"],
|
||||||
|
},
|
||||||
volumes=[
|
volumes=[
|
||||||
"%s:/env/" % (env_path),
|
"%s:/env/" % (env_path),
|
||||||
"%s:/odoo_env/" % (odoo_env_path),
|
"%s:/odoo_env/" % (odoo_env_path),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user