2013-02-21 00:26:29 +00:00
|
|
|
[% WRAPPER layout.tt title=(create ? "New project" : "Editing project $project.name") %]
|
2013-02-21 00:12:57 +00:00
|
|
|
[% PROCESS common.tt %]
|
|
|
|
|
2013-10-03 15:23:41 +00:00
|
|
|
<form class="form-horizontal">
|
2013-02-21 00:45:39 +00:00
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<div class="controls">
|
|
|
|
<label class="checkbox">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="checkbox" name="enabled" [% IF project.enabled; 'checked="checked"'; END %]/>Enabled
|
2013-02-21 00:45:39 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="controls">
|
|
|
|
<label class="checkbox">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="checkbox" name="visible" [% IF !project.hidden; 'checked="checked"'; END %]/>Visible in the list of projects
|
2013-02-21 00:45:39 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Identifier</label>
|
|
|
|
<div class="controls">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="text" class="span3" name="name" [% HTML.attributes(value => project.name) %]/>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Display name</label>
|
|
|
|
<div class="controls">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="text" class="span3" name="displayname" [% HTML.attributes(value => project.displayname) %]/>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Description</label>
|
|
|
|
<div class="controls">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="text" class="span3" name="description" [% HTML.attributes(value => project.description) %]/>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Homepage</label>
|
|
|
|
<div class="controls">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="text" class="span3" name="homepage" [% HTML.attributes(value => project.homepage) %]/>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Owner</label>
|
|
|
|
<div class="controls">
|
2013-09-03 15:35:21 +00:00
|
|
|
<input type="text" class="span3" name="owner" [% HTML.attributes(value => project.owner.username || c.user.username) %]/>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
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
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Declarative spec file</label>
|
|
|
|
<div class="controls">
|
|
|
|
<div class="input-append">
|
|
|
|
<input type="text" class="span3" name="declfile" [% HTML.attributes(value => project.declfile) %]/>
|
|
|
|
</div>
|
|
|
|
<span class="help-inline">(Leave blank for non-declarative project configuration)</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label">Declarative input type</label>
|
|
|
|
<div class="controls">
|
|
|
|
[% INCLUDE renderSelection param="decltype" options=inputTypes edit=1 curValue=project.decltype %]
|
|
|
|
value
|
|
|
|
<input style="width: 70%" type="text" [% HTML.attributes(value => project.declvalue, name => "declvalue") %]/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2013-02-21 00:45:39 +00:00
|
|
|
<div class="form-actions">
|
2013-10-03 15:23:41 +00:00
|
|
|
<button id="submit-project" type="submit" class="btn btn-primary">
|
2013-02-21 00:45:39 +00:00
|
|
|
<i class="icon-ok icon-white"></i>
|
2013-10-03 17:26:17 +00:00
|
|
|
[%IF create %]Create project[% ELSE %]Apply changes[% END %]
|
2013-10-03 15:23:41 +00:00
|
|
|
</button>
|
2013-02-21 00:45:39 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</fieldset>
|
2013-02-21 00:12:57 +00:00
|
|
|
|
|
|
|
</form>
|
|
|
|
|
2013-10-03 16:49:37 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$("#submit-project").click(function() {
|
2013-10-14 15:35:14 +00:00
|
|
|
redirectJSON({
|
2013-10-03 16:49:37 +00:00
|
|
|
[% IF create %]
|
|
|
|
url: "[% c.uri_for('/project' '.new') %]",
|
|
|
|
[% ELSE %]
|
|
|
|
url: "[% c.uri_for('/project' project.name) %]",
|
|
|
|
[% END %]
|
|
|
|
data: $(this).parents("form").serialize(),
|
2013-10-14 15:35:14 +00:00
|
|
|
type: 'PUT'
|
2013-10-03 16:49:37 +00:00
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2013-02-21 00:12:57 +00:00
|
|
|
[% END %]
|