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 %]
2019-07-30 21:51:24 +00:00
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">Actions</a>
<div 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) %]
2013-10-03 15:54:40 +00:00
[% 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 %]
2019-07-30 21:51:24 +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 %]
2019-07-30 21:51:24 +00:00
</div>
2013-10-02 23:17:52 +00:00
</li>
[% END %]
2021-04-08 15:04:37 +00:00
<li class="nav-item"><a class="nav-link active" href="#tabs-project" data-toggle="tab">Jobsets</a></li>
2019-07-30 21:51:24 +00:00
<li class="nav-item"><a class="nav-link" href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
2013-02-21 00:12:57 +00:00
</ul>
<div class="tab-content">
2016-10-27 14:46:20 +00:00
<script type="text/javascript">
2016-11-01 12:03:14 +00:00
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();
2016-10-27 14:46:20 +00:00
});
2016-11-01 12:03:14 +00:00
return false;
};
2016-10-27 14:46:20 +00:00
2016-11-01 12:03:14 +00:00
$(document).ready(function() {
$('#show-hidden, #show-disabled').on('click', function(e) {
$(this).toggleClass('active');
showJobsets();
return false;
2016-10-27 14:46:20 +00:00
});
2016-11-01 12:03:14 +00:00
showJobsets();
2016-10-27 14:46:20 +00:00
});
</script>
2013-02-21 00:12:57 +00:00
<div id="tabs-project" class="tab-pane active">
2013-10-03 11:04:20 +00:00
[% IF project.jobsets %]
2019-07-30 21:51:24 +00:00
<div class="row">
<div class="col">
This project has the following jobsets:
</div>
<div class="col-auto">
<label id="show-disabled" class="btn btn-secondary" data-toggle="button">Show disabled jobsets</label>
[% IF isProjectOwner %]
<label id="show-hidden" class="btn btn-secondary" data-toggle="button">Show hidden jobsets</label>
[% END %]
</div>
</div>
2013-11-05 15:05:29 +00:00
[% INCLUDE renderJobsetOverview %]
2013-02-21 00:12:57 +00:00
[% ELSE %]
<p>No jobsets have been defined yet.</p>
[% END %]
</div>
2013-06-24 23:00:59 +00:00
<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>
2021-12-15 20:32:49 +00:00
<tr>
<th>Enable Dynamic RunCommand Hooks:</th>
2021-12-17 18:31:46 +00:00
<td>[% c.config.dynamicruncommand.enable ? project.enable_dynamic_run_command ? "Yes" : "No (not enabled by project)" : "No (not enabled by server)" %]</td>
2021-12-15 20:32:49 +00:00
</tr>
2013-02-21 00:12:57 +00:00
</table>
</div>
2010-02-05 14:48:22 +00:00
</div>
2013-10-03 15:23:41 +00:00
<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 %]