fc-server: add 'reproduce build' section to build template

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2c9f6951e9b6014a32140216367693de6a6a6964
This commit is contained in:
raf 2026-02-08 21:17:37 +03:00
commit 4597869213
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 186 additions and 22 deletions

View file

@ -53,6 +53,22 @@
<p><a href="{{ build.log_url }}">View log</a></p>
{% endif %}
<h2>Reproduce This Build</h2>
<div class="card">
<div class="card-body">
<p>To reproduce this build locally, run one of the following commands:</p>
<div class="code-block">
<strong>Using Nix (flakes):</strong>
<pre><code>nix build {{ build.drv_path }}^*</code></pre>
</div>
<div class="code-block">
<strong>Using legacy nix-build:</strong>
<pre><code>nix-build {{ build.drv_path }}</code></pre>
</div>
<p class="text-muted">Note: You may need to add this server as a substituter to avoid rebuilding dependencies.</p>
</div>
</div>
<h2>Build Steps</h2>
{% if steps.is_empty() %}
<div class="empty">No steps recorded.</div>

View file

@ -19,14 +19,16 @@
<div class="table-wrap">
<table>
<thead>
<tr><th>Job</th><th>System</th><th>Started</th></tr>
<tr><th>Job</th><th>System</th><th>Started</th><th>Elapsed</th><th>Builder</th></tr>
</thead>
<tbody>
{% for b in running_builds %}
<tr>
<td><a href="/build/{{ b.id }}">{{ b.job_name }}</a></td>
<td>{{ b.system }}</td>
<td>{{ b.created_at }}</td>
<td>{{ b.started_at }}</td>
<td>{{ b.elapsed }}</td>
<td>{% match b.builder_name %}{% when Some with (name) %}{{ name }}{% when None %}local{% endmatch %}</td>
</tr>
{% endfor %}
</tbody>
@ -44,13 +46,15 @@
<div class="table-wrap">
<table>
<thead>
<tr><th>Job</th><th>System</th><th>Created</th></tr>
<tr><th>#</th><th>Job</th><th>System</th><th>Priority</th><th>Created</th></tr>
</thead>
<tbody>
{% for b in pending_builds %}
<tr>
<td>{{ b.queue_pos }}</td>
<td><a href="/build/{{ b.id }}">{{ b.job_name }}</a></td>
<td>{{ b.system }}</td>
<td>{{ b.priority }}</td>
<td>{{ b.created_at }}</td>
</tr>
{% endfor %}