about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-05-02 21:43:31 +0200
committerfranck cuny <franck@lumberjaph.net>2011-05-02 21:43:31 +0200
commitb28268d75688f971f39a24065797ff068cbf5f7b (patch)
treebd02c2b99ee4bb79635b9a535f580902685c0a11 /lib
parentTell the manifest that our readme is markdown (diff)
downloadjitterbug-feature/dashboard.tar.gz
implement some of #12 feature/dashboard
for each project, check the status of the last build. If there is a
FAIL on one version, the project name is in RED, else GREEN.

Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/jitterbug.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/jitterbug.pm b/lib/jitterbug.pm
index 0febc01..dadfbe8 100644
--- a/lib/jitterbug.pm
+++ b/lib/jitterbug.pm
@@ -42,8 +42,16 @@ sub _get_projects {
             my $json = from_json($last_commit->content);
             $proj_desc->{last_build}        = $json;
             $proj_desc->{last_build_author} = $json->{author}{name};
+            # get the status of the last build
+            my $last_build_status = "PASS";
+            foreach my $version (keys %{$json->{build}->{version}}){
+                if ($json->{build}->{version}->{$version} eq "FAIL"){
+                    $last_build_status = "FAIL";
+                    last;
+                }
+            }
+            $proj_desc->{last_build_status} = $last_build_status;
         }
-
         push @projects, $proj_desc;
     }