From 178a6a122946539298a6a064eaa26509eb6f8eac Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sun, 26 Sep 2010 16:53:10 +0200 Subject: mail author when build fail --- scripts/builder.pl | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'scripts/builder.pl') diff --git a/scripts/builder.pl b/scripts/builder.pl index b7b37c0..ae32056 100644 --- a/scripts/builder.pl +++ b/scripts/builder.pl @@ -46,21 +46,32 @@ while (1) { project => $project, repo => $repo, commit => $commit, - status => 1, time => time(), %$desc, }; - my @versions = glob($report_path.'/*'); + my @versions = glob( $report_path . '/*' ); foreach my $version (@versions) { open my $fh, '<', $version; - my @lines = <$fh>; + my @lines = <$fh>; my $result = pop @lines; + while ( $result !~ /^Result/ ) { + $result = pop @lines; + } chomp $result; $result =~ s/Result:\s//; - my ($name, ) = basename($version); + my ( $name, ) = basename($version); $name =~ s/\.txt//; + if ( $result !~ /PASS/ ) { + # mail author of the commit + my $message = $desc->{message}; + my $commiter = $desc->{author}->{email}; + my $output = "Build failed"; + my $sha = $desc->{commit}; + `./scripts/build-failed $commiter $message $output $sha`; + } $build->{version}->{$name} = $result; + close $fh; } my $build_key = join( ':', 'jitterbug', 'build', $commit ); -- cgit 1.4.1