mirror of
https://github.com/odoo/runbot.git
synced 2025-03-30 23:05:44 +07:00
[IMP] runbot: add extra parameters and environment variables to run stages
This commit is contained in:
parent
7e2d7c65a1
commit
237e931e57
@ -338,12 +338,17 @@ class ConfigStep(models.Model):
|
|||||||
if smtp_host:
|
if smtp_host:
|
||||||
cmd += ['--smtp', smtp_host]
|
cmd += ['--smtp', smtp_host]
|
||||||
|
|
||||||
|
extra_params = self.extra_params or ''
|
||||||
|
if extra_params:
|
||||||
|
cmd.extend(shlex.split(extra_params))
|
||||||
|
env_variables = self.additionnal_env.split(';') if self.additionnal_env else []
|
||||||
|
|
||||||
docker_name = build._get_docker_name()
|
docker_name = build._get_docker_name()
|
||||||
build_path = build._path()
|
build_path = build._path()
|
||||||
build_port = build.port
|
build_port = build.port
|
||||||
self.env.cr.commit() # commit before docker run to be 100% sure that db state is consistent with dockers
|
self.env.cr.commit() # commit before docker run to be 100% sure that db state is consistent with dockers
|
||||||
self.invalidate_cache()
|
self.invalidate_cache()
|
||||||
res = docker_run(cmd, log_path, build_path, docker_name, exposed_ports=[build_port, build_port + 1], ro_volumes=exports)
|
res = docker_run(cmd, log_path, build_path, docker_name, exposed_ports=[build_port, build_port + 1], ro_volumes=exports, env_variables=env_variables)
|
||||||
self.env['runbot.runbot']._reload_nginx()
|
self.env['runbot.runbot']._reload_nginx()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -72,9 +72,9 @@
|
|||||||
<field name="test_tags"/>
|
<field name="test_tags"/>
|
||||||
<field name="enable_auto_tags"/>
|
<field name="enable_auto_tags"/>
|
||||||
<field name="sub_command"/>
|
<field name="sub_command"/>
|
||||||
<field name="extra_params" groups="base.group_no_one"/>
|
|
||||||
</group>
|
</group>
|
||||||
<group string="Test settings" attrs="{'invisible': [('job_type', 'not in', ('python', 'install_odoo', 'test_upgrade'))]}">
|
<group string="Extra Parameters" attrs="{'invisible': [('job_type', 'not in', ('python', 'install_odoo', 'test_upgrade', 'run_odoo'))]}">
|
||||||
|
<field name="extra_params"/>
|
||||||
<field name="additionnal_env"/>
|
<field name="additionnal_env"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Create settings" attrs="{'invisible': [('job_type', 'not in', ('python', 'create_build'))]}">
|
<group string="Create settings" attrs="{'invisible': [('job_type', 'not in', ('python', 'create_build'))]}">
|
||||||
|
Loading…
Reference in New Issue
Block a user