From 9571d5f3b3e3acbf07044357ab64e44974c66951 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Mon, 3 Jul 2023 14:22:41 +0200 Subject: [PATCH] [IMP] runbot: add dedicated route for running --- runbot/controllers/frontend.py | 10 ++++++++++ runbot/templates/utils.xml | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index ac2fdc72..aa3b71dd 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -596,3 +596,13 @@ class Runbot(Controller): } return request.render("runbot.load_info", context) + + @route([ + '/runbot/run/', + '/runbot/run//', + ], type='http', auth="public", website=True, sitemap=False) + def access_running(self, build_id, db_suffix=None, **kwargs): + build = request.env['runbot.build'].browse(int(build_id)).exists() + if db_suffix is None: + db_suffix = build.mapped('database_ids')[0].db_suffix + return werkzeug.utils.redirect(f'http://{build.dest}-{db_suffix}.{build.host}') diff --git a/runbot/templates/utils.xml b/runbot/templates/utils.xml index a4ec61cf..1d11b232 100644 --- a/runbot/templates/utils.xml +++ b/runbot/templates/utils.xml @@ -201,7 +201,7 @@ - @@ -213,7 +213,7 @@