Project

General

Profile

Actions

Feature #1655

closed

gitbuilder aggregator page

Added by Sage Weil over 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
qa
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

single page that has 1 line per gitbuilder, with instance name and then the top line of the gitbuilder status screen (branch names + colors).

Actions #1

Updated by Sage Weil over 12 years ago

  • Translation missing: en.field_position set to 7
Actions #2

Updated by Sage Weil over 12 years ago

  • Translation missing: en.field_story_points set to 1
  • Translation missing: en.field_position deleted (10)
  • Translation missing: en.field_position set to 10
Actions #3

Updated by Sage Weil over 12 years ago

  • Target version set to v0.40
  • Translation missing: en.field_position deleted (46)
  • Translation missing: en.field_position set to 42
Actions #4

Updated by Sage Weil over 12 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Jimmy Tang over 12 years ago

Is the source available for the gitbuilders.cgi aggregator? It looks like a pretty useful script for other projects which use gitbuilder for continuous builds.

Actions #6

Updated by Sage Weil over 12 years ago

It's just a quick perl hack. What it really should do is make javascript and <div>s to fetch the results for each builder in parallel.


#!/usr/bin/perl
print "Content-type: text/html\n\n";

my @urls = (
        'http://ceph.newdream.net/gitbuilder-amd64/',
        'http://ceph.newdream.net/gitbuilder-i386/',
        'http://ceph.newdream.net/gitbuilder-deb-amd64/',
#        'http://ceph.newdream.net/gitbuilder-deb-i386/',
        'http://ceph.newdream.net/gitbuilder-gcov-amd64/',
        'http://ceph.newdream.net/gitbuilder-notcmalloc-amd64/',
        'http://ceph.newdream.net/gitbuilder-kernel-amd64/',

);

sub summarize_gitbuilder {
        my ($url, $raw) = @_;
        my ($b) = $raw =~ /(<div id="most_recent">.*)/;
        my ($c) = split(/<\/div>/, $b);
        $c =~ s/Most Recent://;
        $c =~ s/<a href="#/<a href="$url#/g;
        return $c . '</div>';
}

print "<html>\n";
print "<head>\n";
print "<title>Ceph gitbuilders</title><link rel=\"stylesheet\" type=\"text/css\" href=\"gitbuilder.css\" />";
print "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"600\">\n";
print "</head>\n";
print "<body>";
print "<table>";
for my $url (@urls) {
        my $raw = `curl -s $url`;
        my $summary = summarize_gitbuilder($url, $raw);
        #print $summary;
        print "<tr><td align=left id=\"most_recent\" nowrap=\"nowrap\"><a href=\"$url\">$url</a></td><td>$summary</td></tr>\n";
}
print "</table>";
print "</body></html>\n";

Actions #7

Updated by Jimmy Tang about 12 years ago

We've been using this script for the past month or so, and it's been pretty handy. Here's an ajax version of the above perl 'hack', its now available as a javascript hack which a student here whipped up. There are minor issues with it, since it is just a scrapper. but it works well enough.

https://github.com/jcftang/gitbuilder/tree/develop/contrib/gitbuilder-ajax

I haven't pushed this upstream yet, as there's a few more minor tweaks that we want to make to the gitbuilder scripts (such as linking to the errcache in the log outputs and indexes) to make finding error output easier.

Actions #8

Updated by Jimmy Tang about 12 years ago

I took some inspiration from the updated aggregator script that is now at http://ceph.newdream.net/gitbuilder.cgi. I've fixed up the javascript hack to do and behave in the same way as the cgi script. it can be found at https://github.com/jcftang/gitbuilder/tree/develop/contrib/gitbuilder-ajax it's not styled the same but it's easy enough to remove the styling.

I guess this is a nice alternative to running cgi scripts on the server side.

Actions #9

Updated by Jimmy Tang over 11 years ago

I'm not sure if anyone else has asked, but any chance of sharing the updated server side cgi script which now has ajax calls?

Actions #10

Updated by Sage Weil over 11 years ago

#!/usr/bin/perl

use CGI qw(:standard);

my $url = param('url');

# if you change this, update robots.txt as well

my @urls = (
        'http://gitbuilder.sepia.ceph.com/gitbuilder-natty-deb-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-oneiric-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-oneiric-deb-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-i386/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-gcov-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-notcmalloc-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-deb-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-squeeze-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-wheezy-deb-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-kernel-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-centos6-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-sles-11sp2-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-quantal-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-fedora17-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-opensuse12-amd64/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-doc/',
        'http://gitbuilder.sepia.ceph.com/samba-builder/',
        'http://gitbuilder.sepia.ceph.com/gitbuilder-precise-hadoop-amd64/',
);

print "Content-type: text/html\n\n";

sub summarize_gitbuilder {
        my ($url, $raw) = @_;
        my ($b) = $raw =~ /(<div id="most_recent">.*)/;
        my ($c) = split(/<\/div>/, $b);
        $c =~ s/Most Recent://;
        $c =~ s/<a href="#/<a href="$url#/g;
        return $c . '</div>';
}

print "<html>\n";
print "<head>\n";
print "<script src=\"http://code.jquery.com/jquery-latest.js\"></script>\n";
print "<title>Ceph gitbuilders</title><link rel=\"stylesheet\" type=\"text/css\" href=\"gitbuilder.css\" />";
print "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"600\">\n";
print "</head>\n";
print "<body>";

my $script = '';

if ($url) {
        my $raw = `curl -s $url 2>&1`;
        my $summary = summarize_gitbuilder($url, $raw);
        print $summary;
} else {
        print "<table>";
        my $n = 1;
        for my $url (@urls) {
                print "<tr><td align=left id=\"most_recent\" 
nowrap=\"nowrap\"><a href=\"$url\">$url</a></td><td id=\"most_recent\"><div 
id=\"num$n\">...loading...</div></td></tr>\n";
                $script .= "\$\(\"#num$n\"\).load(\"/gitbuilder.cgi?url=$url\");\n";
                $n++;
        }
        print "</table>";
}

print " 
<script>
$script
</script>
";

print "</body></html>\n";
Actions

Also available in: Atom PDF