Skip to content

Commit 64ef9e4

Browse files
committed
update compatible with aws mode
1 parent 41b5fef commit 64ef9e4

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

wodoo/lib_bakery.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ def bake(ctx, config, params, no_update_images):
141141
* odoo setting RUN_CRONJOBS=0
142142
""",
143143
"7. Setting up connection to database and other settings",
144+
"8. To configure odoo container to make updates at startup, configure:",
145+
"""
146+
* UPDATE_ON_STARTUP=1
147+
* UPDATE_PARAMS=--i18n --> parameter for update command; e.g. in this case for force update translations
148+
* PERSIST_UPDATE_LOG=/path/to/persist/ <!-- update log will be put here
149+
"""
144150
]
145151
for tip in tips:
146152
click.secho(tip, fg="green")

wodoo/lib_control_with_docker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ def logall(config, machines, follow, lines):
399399

400400
def shell(config, command="", queuejobs=False):
401401
if os.getenv("DOCKER_MACHINE") == "1":
402-
subprocess.run(["/odoolib/entrypoint.sh", "/odoolib/shell.py"])
402+
cmdline = ["/odoolib/entrypoint.sh", "/odoolib/shell.py"]
403+
if command:
404+
cmdline += [command]
405+
subprocess.run(cmdline)
403406
return
404407
cmd = [
405408
"run",

wodoo/lib_module.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ def extract_progress(text):
815815
else:
816816
break
817817

818-
if not no_restart and config.use_docker:
818+
if not no_restart and config.use_docker and os.getenv("DOCKER_MACHINE") != "1":
819819
Commands.invoke(ctx, "restart", machines=["odoo"])
820820
if config.run_odoocronjobs:
821821
Commands.invoke(ctx, "restart", machines=["odoo_cronjobs"])
@@ -1102,7 +1102,8 @@ def _uninstall_marked_modules(ctx, config, modules, no_restart=False):
11021102
uninstalled = True
11031103

11041104
if uninstalled and not no_restart:
1105-
Commands.invoke(ctx, "restart", machines=["odoo"])
1105+
if os.getenv("DOCKER_MACHINE") != "1":
1106+
Commands.invoke(ctx, "restart", machines=["odoo"])
11061107

11071108
modules = [x for x in modules if DBModules.is_module_installed(x)]
11081109
if modules:
@@ -1209,31 +1210,32 @@ def _exec_update(
12091210
if os.getenv("DOCKER_MACHINE") == "1":
12101211
ret = subprocess.run([os.getenv("WODOO_PYTHON")] + ["/odoolib/update_modules.py"] + params)
12111212
yield ret.returncode
1212-
params = ["odoo_update", "/odoolib/update_modules.py"] + params
1213-
if not non_interactive:
1214-
yield __cmd_interactive(
1215-
config,
1216-
*(
1217-
[
1218-
"run",
1219-
"--rm",
1220-
]
1221-
+ params
1222-
),
1223-
)
12241213
else:
1225-
try:
1226-
returncode, output = __dcrun(
1214+
params = ["odoo_update", "/odoolib/update_modules.py"] + params
1215+
if not non_interactive:
1216+
yield __cmd_interactive(
12271217
config,
1228-
list(params),
1229-
returnproc=True,
1230-
interactive=False,
1231-
write_to_console=write_to_console,
1218+
*(
1219+
[
1220+
"run",
1221+
"--rm",
1222+
]
1223+
+ params
1224+
),
12321225
)
1233-
yield returncode
1234-
yield output
1235-
except subprocess.CalledProcessError as ex:
1236-
yield ex.returncode
1226+
else:
1227+
try:
1228+
returncode, output = __dcrun(
1229+
config,
1230+
list(params),
1231+
returnproc=True,
1232+
interactive=False,
1233+
write_to_console=write_to_console,
1234+
)
1235+
yield returncode
1236+
yield output
1237+
except subprocess.CalledProcessError as ex:
1238+
yield ex.returncode
12371239

12381240

12391241
def _get_unittests_from_module(module_name):

0 commit comments

Comments
 (0)