OXYGENHUB
# 2e9188ca4f98 oxygenhub / templates / flow_runs.html
3.3 KiB · HTML · last changed Run pipeline from bookmarks and changes, and say why it is unavailable 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}Flow · {{ repo.owner }}/{{ repo.name }}{% endblock %}
4
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %}
5
{% block tabs %}{% call m::tabs(repo, "flow") %}{% endblock %}
6
{% block content %}
7
<div class="head"><h1>Flow <small>pipeline runs</small></h1>
8
{% if can_run %}<form class="inline" method="post" action="{{ repo.url }}/flow/start"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><label for="run-bookmark" class="small mute">Run the pipeline of</label> <select id="run-bookmark" name="bookmark">{% for b in bookmarks %}<option value="{{ b }}">{{ b }}</option>{% endfor %}</select> <button type="submit" class="primary-btn">Run pipeline</button></form>{% endif %}
9
</div>
10
{% if let Some(w) = why_not %}<p class="small mute">{{ w }}</p>{% endif %}
11
{% if let Some(e) = error %}<p class="error">Could not start a run: {{ e }}</p>{% endif %}
12
{% if runs.is_empty() %}
13
<section class="panel">
14
  {% if enabled %}
15
  <p>No runs yet. Add <code>.flow/pipeline.kdl</code> to a bookmark and push: every push that moves a bookmark runs it in OxygenFlow microVMs. Once it is there, <strong>Run pipeline</strong> above runs a bookmark's current state without a push, as does the button beside each bookmark and on each change.</p>
16
  {% else %}
17
  <p>OxygenFlow is not enabled for this repository. A site administrator turns it on under <a href="{{ repo.url }}/settings#flow">Settings → OxygenFlow</a>.</p>
18
  {% endif %}
19
<pre class="snippet">schema-version 1
20
21
sandbox "alpine" {
22
    runtime "microvm"
23
    rootfs "cas://blob/…"   // flow rootfs import prints this
24
    memory-limit "512MiB"
25
}
26
27
job "test" {
28
    sandbox "alpine"
29
    exec "sh" "-eu" "test.sh"
30
}</pre>
31
</section>
32
{% else %}
33
<table class="list flow-runs">
34
  <thead><tr><th></th><th>Run</th><th>Jobs</th><th>Bookmark</th><th>State</th><th>By</th><th>When</th><th>Took</th></tr></thead>
35
  <tbody>
36
  {% for row in runs %}
37
  <tr class="st-{{ row.r.status }}">
38
    <td class="st"><span class="flow-glyph st-{{ row.r.status }}" title="{{ row.r.status }}">{{ crate::web::flow::glyph(row.r.status) }}</span></td>
39
    <td><a href="{{ repo.url }}/flow/{{ row.r.number }}"><strong>#{{ row.r.number }}</strong></a> <span class="small mute">{{ row.r.status }}{% if let Some(p) = row.place %}, {{ p }}{% endif %}</span></td>
40
    <td class="flow-dots">{% for (n, s) in row.jobs %}<span class="flow-glyph st-{{ s }}" title="{{ n }}: {{ s }}">{{ crate::web::flow::glyph(s) }}</span>{% endfor %}{% if row.r.status == "error" %}<span class="small bad">pipeline invalid</span>{% endif %}</td>
41
    <td>{% if row.r.bookmark.is_empty() %}<span class="tag" title="Run on one change, not a bookmark">change</span>{% else %}<span class="lbl lbl-bm">{{ row.r.bookmark }}</span>{% endif %}</td>
42
    <td><a href="{{ repo.url }}/tree/{{ row.r.heads }}" title="state {{ row.r.state }}"><code>{{ row.r.state|short }}</code></a></td>
43
    <td>{{ row.r.actor }}</td>
44
    <td><time title="{{ row.r.created_ms|when_i }}">{{ row.r.created_ms|ago_i }}</time></td>
45
    <td class="small mute">{{ row.duration }}</td>
46
  </tr>
47
  {% endfor %}
48
  </tbody>
49
</table>
50
{% if let Some(b) = older %}<p class="center"><a class="go small" href="{{ repo.url }}/flow?before={{ b }}">older runs</a></p>{% endif %}
51
{% endif %}
52
{% endblock %}