diff --git a/runbot/models/build.py b/runbot/models/build.py index 4be7863c..c424ff76 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -851,7 +851,7 @@ class runbot_build(models.Model): self._log('server_info', 'No server found in %s' % commit, level='ERROR') raise ValidationError('No server found in %s' % commit) - def _cmd(self, python_params=None, py_version=None): + def _cmd(self, python_params=None, py_version=None, local_only=True): """Return a list describing the command to start the build """ self.ensure_one() @@ -868,6 +868,11 @@ class runbot_build(models.Model): cmd = ['python%s' % py_version] + python_params + [os.path.join(server_dir, server_file), '--addons-path', ",".join(addons_paths)] # options config_path = build._server("tools/config.py") + if local_only: + if grep(config_path, "--http-interface"): + cmd.append("--http-interface=127.0.0.1") + elif grep(config_path, "--xmlrpc-interface"): + cmd.append("--xmlrpc-interface=127.0.0.1") if grep(config_path, "no-xmlrpcs"): # move that to configs ? cmd.append("--no-xmlrpcs") if grep(config_path, "no-netrpc"): diff --git a/runbot/models/build_config.py b/runbot/models/build_config.py index d3c56e78..bf6a2606 100644 --- a/runbot/models/build_config.py +++ b/runbot/models/build_config.py @@ -242,7 +242,7 @@ class ConfigStep(models.Model): # adjust job_end to record an accurate job_20 job_time build._log('run', 'Start running build %s' % build.dest) # run server - cmd = build._cmd() + cmd = build._cmd(local_only=False) if os.path.exists(build._get_server_commit()._source_path('addons/im_livechat')): cmd += ["--workers", "2"] cmd += ["--longpolling-port", "8070"]