internal/web/templates/build.html

28 lines · 2079 bytes

 1{{define "width"}}wide{{end}}
 2{{define "title"}}build {{.Build.Number}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 3{{define "content"}}
 4<div id="build-root">
 5{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
 6<div class="headrow">
 7<h1>Build {{.Build.Number}} <span class="chip check-{{.Build.Status}}">{{.Build.Status}}</span></h1>
 8<span class="spacer"></span>
 9<div class="btngroup">
10{{if not .Live}}<button type="button" class="btn" data-refresh="self" data-refresh-target="build-root">Refresh</button>{{end}}
11{{if and .CanWrite (or (eq .Build.Status "pending") (eq .Build.Status "running"))}}
12<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds/{{.Build.Number}}/cancel" class="inline">
13  <button type="submit" class="danger">{{if eq .Build.Status "running"}}Cancel (stops at the runner's next check){{else}}Cancel{{end}}</button>
14</form>
15{{end}}
16</div>
17</div>
18<p class="meta">{{.Build.Job}} on {{.Build.Ref}} · <code><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.Build.SHA}}">{{printf "%.10s" .Build.SHA}}</a></code> · queued {{when .Build.CreatedAt}}{{if .Build.FinishedAt}} · finished {{when .Build.FinishedAt}}{{with .Duration}} · ran {{.}}{{end}}{{end}}{{if .Failed}} · <a href="#failed">Jump to failure</a>{{end}}</p>
19{{if .Live}}<p class="meta">This page updates itself until the build ends. If it stops without a “build finished” line, reload to pick it up again. <a href="?follow=0">Show it without updates</a></p>
20<pre class="code buildlog" tabindex="0">{{.Log}}</pre>
21{{else if .Steps}}{{$total := len .Build.Steps}}{{range .Steps}}
22<details class="difffold buildstep"{{if .Failed}} id="failed" open{{end}}>
23  <summary>{{if .N}}<span>step {{.N}}/{{$total}}</span> <code>{{.Head}}</code>{{else}}<span>setup</span>{{end}}{{if .Failed}} <span class="chip check-failure">failed</span>{{end}}</summary>
24  <pre class="code buildlog" tabindex="0">{{.Text}}</pre>
25</details>{{end}}
26{{else if .Log}}<pre class="code buildlog" tabindex="0">{{.Log}}</pre>{{else}}<p class="empty-note">no log yet</p>{{end}}
27</div>
28{{end}}