2021-04-29 23:41:23 +02:00
|
|
|
# Server for the Verificarlo CI report. This is simply a wrapper to avoid
|
|
|
|
# calling Bokeh directly.
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2021-05-03 15:47:44 +02:00
|
|
|
|
2021-04-29 23:41:23 +02:00
|
|
|
def serve(show, git_directory, git_url, port, allow_origin, logo_url):
|
|
|
|
|
|
|
|
# Prepare arguments
|
|
|
|
show = "--show" if show else ""
|
|
|
|
|
|
|
|
git = ""
|
2021-05-03 15:47:44 +02:00
|
|
|
if git_directory is not None:
|
2021-04-29 23:41:23 +02:00
|
|
|
git = "git directory %s" % git_directory
|
2021-05-03 15:47:44 +02:00
|
|
|
if git_url is not None:
|
2021-04-29 23:41:23 +02:00
|
|
|
git = "git url %s" % git_url
|
|
|
|
|
|
|
|
logo = ""
|
2021-05-03 15:47:44 +02:00
|
|
|
if logo_url is not None:
|
2021-04-29 23:41:23 +02:00
|
|
|
logo = "logo %s" % logo_url
|
|
|
|
|
|
|
|
dirname = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
# Call the "bokeh serve" command on the system
|
|
|
|
command = "bokeh serve %s/vfc_ci_report %s --allow-websocket-origin=%s:%s --port %s --args %s %s" \
|
2021-05-03 15:47:44 +02:00
|
|
|
% (dirname, show, allow_origin, port, port, git, logo)
|
2021-04-29 23:41:23 +02:00
|
|
|
|
|
|
|
os.system(command)
|