Commit 02b2f765 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat: display cubes status

parent 40360795ba54
......@@ -33,7 +33,35 @@ for project in all_core_projects:
"jobs": [job.attributes for job in pipeline_for_default.jobs.list(all=True)],
}
os.system("mkdir -p build")
all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"]
for cube in all_cubes:
# grab the pipelines for default branch that hasn't been triggered from another pipeline
pipeline_for_default = None
for pipeline in cube.pipelines.list(as_list=False, all=True):
if pipeline.ref != "branch/default":
continue
if "TRIGGERED_FROM_OTHER_PROJECT" in {x.key for x in pipeline.variables.list()}:
continue
pipeline_for_default = pipeline
break
if pipeline_for_default:
jobs = [job.attributes for job in pipeline_for_default.jobs.list(all=True)]
else:
jobs = None
context["cubes"][cube.name] = {
"project": cube.attributes,
"pipeline": pipeline.attributes,
"jobs": jobs,
}
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)
......
......@@ -29,5 +29,33 @@
</tr>
{% endfor %}
</table>
<h2>Cubes</h2>
<table class="pipelines">
{% for cube in cubes.values() %}
<tr>
<th>
<a target="_blank" href="{{ cube["project"]["web_url"] }}">
{{ cube["project"]["name"] }}
</a>
</th>
{% if cube["jobs"] %}
{% for job in cube["jobs"] %}
<td>
{% if job["status"] == "failed" and job["allow_failure"] %}
<div class="job job-warning">!</div>
{% else %}
<div class="job job-{{ job["status"] }}"> </div>
{% endif %}
{{ job["name"] }}
</td>
{% endfor %}
{% else %}
<td>No pipeline for this cube</td>
{% endif %}
</tr>
{% endfor %}
</table>
</body>
</html>
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