hydra/src/root/project.tt

146 lines
4.3 KiB
Plaintext
Raw Normal View History

2013-02-21 00:12:57 +00:00
[% WRAPPER layout.tt title="Project $project.name" %]
2008-11-17 23:59:20 +00:00
[% PROCESS common.tt %]
2013-02-21 00:12:57 +00:00
<ul class="nav nav-tabs">
2013-10-02 23:17:52 +00:00
[% IF c.user_exists %]
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Actions
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
2013-10-14 15:43:31 +00:00
[% INCLUDE menuItem title="Edit configuration" icon="icon-edit" uri=c.uri_for(c.controller('Project').action_for('edit'), c.req.captures) %]
[% INCLUDE menuItem title="Delete this project" icon="icon-trash" uri="javascript:deleteProject()" %]
Enable declarative projects. This allows fully declarative project specifications. This is best illustrated by example: * I create a new project, setting the declarative spec file to "spec.json" and the declarative input to a git repo pointing at git://github.com/shlevy/declarative-hydra-example.git * hydra creates a special ".jobsets" jobset alongside the project * Just before evaluating the ".jobsets" jobset, hydra fetches declarative-hydra-example.git, reads spec.json as a jobset spec, and updates the jobset's configuration accordingly: { "enabled": 1, "hidden": false, "description": "Jobsets", "nixexprinput": "src", "nixexprpath": "default.nix", "checkinterval": 300, "schedulingshares": 100, "enableemail": false, "emailoverride": "", "keepnr": 3, "inputs": { "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false } } } * When the "jobsets" job of the ".jobsets" jobset completes, hydra reads its output as a JSON representation of a dictionary of jobset specs and creates a jobset named "master" configured accordingly (In this example, this is the same configuration as .jobsets itself, except using release.nix instead of default.nix): { "enabled": 1, "hidden": false, "description": "js", "nixexprinput": "src", "nixexprpath": "release.nix", "checkinterval": 300, "schedulingshares": 100, "enableemail": false, "emailoverride": "", "keepnr": 3, "inputs": { "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false } } }
2016-03-11 23:14:58 +00:00
[% UNLESS project.declfile %]
2013-10-14 15:43:31 +00:00
[% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), c.req.captures) %]
Enable declarative projects. This allows fully declarative project specifications. This is best illustrated by example: * I create a new project, setting the declarative spec file to "spec.json" and the declarative input to a git repo pointing at git://github.com/shlevy/declarative-hydra-example.git * hydra creates a special ".jobsets" jobset alongside the project * Just before evaluating the ".jobsets" jobset, hydra fetches declarative-hydra-example.git, reads spec.json as a jobset spec, and updates the jobset's configuration accordingly: { "enabled": 1, "hidden": false, "description": "Jobsets", "nixexprinput": "src", "nixexprpath": "default.nix", "checkinterval": 300, "schedulingshares": 100, "enableemail": false, "emailoverride": "", "keepnr": 3, "inputs": { "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false } } } * When the "jobsets" job of the ".jobsets" jobset completes, hydra reads its output as a JSON representation of a dictionary of jobset specs and creates a jobset named "master" configured accordingly (In this example, this is the same configuration as .jobsets itself, except using release.nix instead of default.nix): { "enabled": 1, "hidden": false, "description": "js", "nixexprinput": "src", "nixexprpath": "release.nix", "checkinterval": 300, "schedulingshares": 100, "enableemail": false, "emailoverride": "", "keepnr": 3, "inputs": { "src": { "type": "git", "value": "git://github.com/shlevy/declarative-hydra-example.git", "emailresponsible": false }, "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs.git release-16.03", "emailresponsible": false } } }
2016-03-11 23:14:58 +00:00
[% END %]
2013-10-14 15:43:31 +00:00
[% INCLUDE menuItem title="Create release" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_release'), c.req.captures) %]
2013-10-02 23:17:52 +00:00
</ul>
</li>
[% END %]
2013-02-21 00:12:57 +00:00
<li class="active"><a href="#tabs-project" data-toggle="tab">Jobsets</a></li>
<li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
<li><a href="#tabs-releases" data-toggle="tab">Releases</a></li>
2013-02-21 00:12:57 +00:00
</ul>
<div class="tab-content">
<script type="text/javascript">
function showJobsets() {
var showHidden = $('#show-hidden').hasClass('active');
var showDisabled = $('#show-disabled').hasClass('active');
$('tr.jobset').map(function() {
var hide =
($(this).hasClass('hidden-jobset') && !showHidden) ||
($(this).hasClass('disabled-jobset') && !showDisabled);
if (hide) $(this).hide(); else $(this).show();
});
return false;
};
$(document).ready(function() {
$('#show-hidden, #show-disabled').on('click', function(e) {
$(this).toggleClass('active');
showJobsets();
return false;
});
showJobsets();
});
</script>
2013-02-21 00:12:57 +00:00
<div id="tabs-project" class="tab-pane active">
[% IF project.jobsets %]
<p>This project has the following jobsets:
2017-12-05 13:07:58 +00:00
<label id="show-disabled" class="btn btn-small pull-right" data-toggle="button">Show disabled jobsets</label>
[% IF isProjectOwner %]
<label id="show-hidden" class="btn btn-small pull-right" data-toggle="button">Show hidden jobsets</label>
[% END %]
</p>
[% INCLUDE renderJobsetOverview %]
2013-02-21 00:12:57 +00:00
[% ELSE %]
<p>No jobsets have been defined yet.</p>
[% END %]
</div>
<div id="tabs-configuration" class="tab-pane">
2013-02-21 12:42:44 +00:00
<table class="info-table">
2013-02-21 00:12:57 +00:00
<tr>
<th>Display name:</th>
<td>[% HTML.escape(project.displayname) %]</td>
</tr>
<tr>
<th>Description:</th>
<td>[% HTML.escape(project.description) %]</td>
</tr>
<tr>
<th>Homepage:</th>
<td>
[% IF project.homepage %]
<a [% HTML.attributes(href => project.homepage) %]>[% HTML.escape(project.homepage) %]</a>
[% ELSE %]
<em>(not specified)</em>
[% END %]
</td>
</tr>
<tr>
<th>Owner:</th>
<td><tt>[% HTML.escape(project.owner.username) %]</tt></td>
</tr>
<tr>
<th>Enabled:</th>
<td>[% project.enabled ? "Yes" : "No" %]</td>
</tr>
</table>
</div>
<div id="tabs-releases" class="tab-pane">
[% IF releases.size == 0 %]
<p><em>This project has no releases yet.</em></p>
[% ELSE %]
<p>This project has made the following releases:</p>
<table class="table table-condensed table-striped clickable-rows">
<thead>
<tr>
<th>Name</th>
<th>Date</th>
</tr>
</thead>
<tbody>
[% FOREACH release IN releases %]
<tr>
<td><a class="row-link" href="[% c.uri_for('/release' project.name release.name) %]"><tt>[% release.name %]</tt></a></td>
<td>[% INCLUDE renderDateTime timestamp = release.timestamp %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
</div>
</div>
<script>
function deleteProject() {
bootbox.confirm(
'Are you sure you want to delete this project?',
function(c) {
if (!c) return;
redirectJSON({
url: "[% c.uri_for('/project' project.name) %]",
type: 'DELETE'
});
});
};
</script>
2008-11-10 13:33:12 +00:00
[% END %]