* Make jobsets viewable under

http://server/jobset/<project>/<jobset>.
This commit is contained in:
Eelco Dolstra 2009-03-13 15:23:08 +00:00
parent ae364b9e5f
commit 3af294f848
3 changed files with 43 additions and 3 deletions

View file

@ -35,7 +35,7 @@ sub get_builds : Chained('job') PathPart('') CaptureArgs(0) {
$c->stash->{allBuilds} =
$c->stash->{jobset}->builds->search({job => $c->stash->{jobName}});
$c->stash->{channelBaseName} =
$c->stash->{curProject}->name . "-" . $c->stash->{jobName};
$c->stash->{curProject}->name . "-" . $c->stash->{jobset}->name . "-" . $c->stash->{jobName};
}

View file

@ -0,0 +1,39 @@
package Hydra::Controller::Jobset;
use strict;
use warnings;
use base 'Hydra::Base::Controller::ListBuilds';
use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
sub jobset : Chained('/') PathPart('jobset') CaptureArgs(2) {
my ($self, $c, $projectName, $jobsetName) = @_;
my $project = $c->model('DB::Projects')->find($projectName)
or notFound($c, "Project $projectName doesn't exist.");
$c->stash->{curProject} = $project;
$c->stash->{jobset} = $project->jobsets->find({name => $jobsetName})
or notFound($c, "Jobset $jobsetName doesn't exist.");
}
sub index : Chained('jobset') PathPart('') Args(0) {
my ($self, $c) = @_;
$c->go($self->action_for("all"));
}
# Hydra::Base::Controller::ListBuilds needs this.
sub get_builds : Chained('jobset') PathPart('') CaptureArgs(0) {
my ($self, $c) = @_;
$c->stash->{allBuilds} =
$c->stash->{jobset}->builds;
$c->stash->{channelBaseName} =
$c->stash->{curProject}->name . "-" . $c->stash->{jobset}->name;
}
1;

View file

@ -2,8 +2,9 @@
[% PROCESS common.tt %]
<h1>All Builds
[% IF jobName %]for Job [% curProject.name %]:[% jobset.name %]:[% jobName %][% ELSE %]
[% IF curProject %] for Project <tt>[% curProject.name %]</tt>[% END %][% END %]</h1>
[% IF jobName %]for Job [% curProject.name %]:[% jobset.name %]:[% jobName %]
[% ELSIF jobset %]for Jobset [% curProject.name %]:[% jobset.name %]
[% ELSIF curProject %] for Project <tt>[% curProject.name %]</tt>[% END %]</h1>
<p>Showing builds [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + builds.size %]
out of [% totalBuilds %] in order of descending timestamp.</p>