From f44128275c50a132632c5c01facd61a1e97035c0 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 10 Feb 2010 10:15:09 +0000 Subject: [PATCH] * hydra: added initial version of build graph --- release.nix | 6 +++ src/lib/Hydra/Controller/Build.pm | 14 +++++++ src/root/build.tt | 67 +++++++++++++++++++++++++++++-- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/release.nix b/release.nix index c813e763..14aabcc2 100644 --- a/release.nix +++ b/release.nix @@ -30,12 +30,18 @@ let sha256 = "013zgglvifvy0yg0ybjrl823sswy9v1ihf5nmighmcyigfd6nrhb"; }; + flot = fetchurl { + url = http://flot.googlecode.com/files/flot-0.6.zip; + sha256 = "1k2mfijvr1jwga65wcd78lp9ia17v99f1cfm5nlmc0k8glllbj5a"; + }; + # Since we don't have a `make dist', just tar everything. distPhase = '' ensureDir src/root/static/js/jquery unzip -d src/root/static/js/jquery $jquery rm -rf src/root/static/js/tablesorter unzip -d src/root/static/js $tablesorter + unzip -d src/root/static/js $flot make -C src/sql diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index b075458f..73a7264b 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -50,6 +50,20 @@ sub view_build : Chained('build') PathPart('') Args(0) { $c->stash->{logtext} = `tail -n 50 $path`; } + if($build->finished) { + $c->stash->{prevBuilds} = [joinWithResultInfo($c, $c->model('DB::Builds'))->search( + { project => $c->stash->{project}->name + , jobset => $c->stash->{build}->jobset->name + , job => $c->stash->{build}->job->name + , system => $build->system + , finished => 1 + , buildstatus => 0 + } + , { order_by => "id DESC", rows => 20 } + ) + ]; + } + } diff --git a/src/root/build.tt b/src/root/build.tt index bc574339..3757464a 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -81,17 +81,17 @@

[% flashMsg %]

[% END %] - -
+
@@ -415,6 +415,67 @@ [% END %] +
+ +
+ + + + +
+