Support obtaining the contents of an evaluation as a channel

E.g. http://hydra.nixos.org/eval/552513/channel

The advantage of such a channel is that all builds come from the same
evaluation, and thus are consistent.
This commit is contained in:
Eelco Dolstra 2012-04-02 23:25:07 +02:00
parent 3e57cbfeb8
commit 262f068e26

View file

@ -2,7 +2,7 @@ package Hydra::Controller::JobsetEval;
use strict;
use warnings;
use base 'Catalyst::Controller';
use base 'Hydra::Base::Controller::NixChannel';
use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
@ -99,4 +99,14 @@ sub view : Chained('eval') PathPart('') Args(0) {
}
# Hydra::Base::Controller::NixChannel needs this.
sub nix : Chained('eval') PathPart('channel') CaptureArgs(0) {
my ($self, $c) = @_;
$c->stash->{channelName} = $c->stash->{project}->name . "-" . $c->stash->{jobset}->name . "-latest";
$c->stash->{channelBuilds} = $c->stash->{eval}->builds
->search_literal("exists (select 1 from buildproducts where build = build.id and type = 'nix-build')")
->search({ finished => 1, buildstatus => 0 }, { columns => [@buildListColumns, 'drvpath', 'outpath', 'description', 'homepage'] });
}
1;