[IMP] runbot: add extra parameters and environment variables to run stages

This commit is contained in:
David James 2020-10-10 18:55:23 +11:00 committed by XavierDo
parent 7e2d7c65a1
commit 237e931e57
2 changed files with 8 additions and 3 deletions

View File

@ -338,12 +338,17 @@ class ConfigStep(models.Model):
if 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()
build_path = build._path()
build_port = build.port
self.env.cr.commit() # commit before docker run to be 100% sure that db state is consistent with dockers
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()
return res

View File

@ -72,9 +72,9 @@
<field name="test_tags"/>
<field name="enable_auto_tags"/>
<field name="sub_command"/>
<field name="extra_params" groups="base.group_no_one"/>
</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"/>
</group>
<group string="Create settings" attrs="{'invisible': [('job_type', 'not in', ('python', 'create_build'))]}">