Commit 8f839be0 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat: include css inside generated html pages for easier usage as artifacts

parent dd1a71adb104
Pipeline #11920 passed with stage
in 1 minute and 19 seconds
......@@ -7,7 +7,6 @@ mr_center:
- TOKEN=$GITLAB_TOKEN python mr_center.py
artifacts:
paths:
- style.css
- build/mr.html
expire_in: 1 hour
......@@ -18,6 +17,5 @@ pipelines_status:
- TOKEN=$GITLAB_TOKEN python pipelines_status.py
artifacts:
paths:
- style.css
- build/index.html
expire_in: 1 hour
......@@ -68,6 +68,9 @@ for cube in all_cubes:
"labels": {x.name: x.attributes for x in project.labels.list(all=True)}
}
context["css"] = open("./style.css", "r").read()
os.system("mkdir -p build") # XXX lazy
result = jinja2.Template(open("template/mr.html", "r").read()).render(**context)
open("build/mr.html", "w").write(result)
......
......@@ -61,6 +61,8 @@ for cube in all_cubes:
"jobs": jobs,
}
context["css"] = open("./style.css", "r").read()
os.system("mkdir -p build") # XXX lazy
result = jinja2.Template(open("template/index.html", "r").read()).render(**context)
open("build/index.html", "w").write(result)
......
......@@ -2,7 +2,9 @@
<html>
<head>
<title>Latest Build status</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
{{ css }}
</style>
</head>
<body>
<h1>Is everything green?</h1>
......
......@@ -2,7 +2,9 @@
<html>
<head>
<title>All open MRs</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen">
{{ css }}
</style>
</head>
<body>
<h1>MR Center <small>all PR that needs attention</small></h1>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment