"LineageOS Builds",
View('Builds', '.web_index'),
View('Runners', '.web_runners'),
- View('Stats', '.web_stats')
+ View('Devices', '.web_devices'),
+ View('Stats', '.web_stats'),
))
headers = {'Private-Token': os.environ.get('GITLAB_TOKEN', '')}
).group_by(models.Runner.runner_id).order_by(subquery.c.build_date.desc(), models.Runner.runner_name).all()
return render_template('runners.html', runners=runners)
+@app.route("/devices/")
+def web_devices():
+ builds = models.Build.query.filter(models.Build.build_date > datetime.date.today() - datetime.timedelta(90)).group_by(models.Build.build_device).having(func.max(models.Build.build_date)).order_by(func.lower(models.Build.build_device)).all()
+ return render_template("devices.html", builds=builds)
+
@app.route('/api/v1/builds')
def api_builds():
try:
<th scope="col">Runner</th>
</tr>
{% for build in builds.items %}
- <tr>
+ {% if build.build_status == "success" %}
+ {% set color = "default" %}
+ {% elif build.build_status == "pending" %}
+ {% set color = "info" %}
+ {% elif build.build_status == "failed" %}
+ {% set color = "danger" %}
+ {% else %}
+ {% set color = "warning" %}
+ {% endif %}
+ <tr class="{{color}}">
<th scope="row"><a href="https://gitlab.com/LineageOS/builder/android/pipelines/{{build.build_id}}">{{build.build_id}}</a></th>
<td>{{build.build_status}}</td>
<td>{{build.build_device}}</td>
--- /dev/null
+{%- extends "base.html" %}
+
+
+{% import "bootstrap/utils.html" as utils %}
+{% block content %}
+ <div class="container">
+ <table class="table table-striped">
+ <tr>
+ <th scope="col">ID</th>
+ <th scope="col">Status</th>
+ <th scope="col">Device</th>
+ <th scope="col">Version</th>
+ <th scope="col">Type</th>
+ <th scope="col">Date</th>
+ <th scope="col">Duration</th>
+ <th scope="col">Runner</th>
+ </tr>
+ {% for build in builds %}
+ {% if build.build_status == "success" %}
+ {% set color = "default" %}
+ {% elif build.build_status == "pending" %}
+ {% set color = "info" %}
+ {% elif build.build_status == "failed" %}
+ {% set color = "danger" %}
+ {% else %}
+ {% set color = "warning" %}
+ {% endif %}
+ <tr class="{{color}}">
+ <th scope="row"><a href="https://gitlab.com/LineageOS/builder/android/pipelines/{{build.build_id}}">{{build.build_id}}</a></th>
+ <td>{{build.build_status}}</td>
+ <td>{{build.build_device}}</td>
+ <td>{{build.build_version}}</td>
+ <td>{{build.build_type}}</td>
+ <td>{{build.build_date}}</td>
+ <td>{% if build.build_duration %}{{(build.build_duration / 60) | round(2)}} min{% endif %}</td>
+ <td><a href="/runners/{{build.build_runner.runner_name}}">{{build.build_runner.runner_name}}</a></td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+{% include "footer.html" %}
+{% endblock %}