diff --git a/src/tools/testcoordinator/buildall.pl b/src/tools/testcoordinator/buildall.pl old mode 100644 new mode 100755 diff --git a/src/tools/testcoordinator/passes.pl b/src/tools/testcoordinator/passes.pl new file mode 100755 index 00000000..c7ca9bde --- /dev/null +++ b/src/tools/testcoordinator/passes.pl @@ -0,0 +1,17 @@ +#!perl -w +use strict; +use warnings; +use POSIX "strftime"; + +# Now parse the combined logs extracting build pass messages +# lub32 20.47.55 --- Branch v2docs ubuntu gcc ILP32 confidence tests passed --- + +open(my $buildlog, "log/buildpasses.log") // die "Could not create buildpasses.log."; +while (<$buildlog>) { + if (/ --- Branch .* confidence tests passed ---/) { + print $passes $_; + } +} +close($buildlog); +close($passes); diff --git a/src/tools/testcoordinator/postpush.pl b/src/tools/testcoordinator/postpush.pl old mode 100644 new mode 100755 index 947ef1d5..25bb2a89 --- a/src/tools/testcoordinator/postpush.pl +++ b/src/tools/testcoordinator/postpush.pl @@ -9,7 +9,6 @@ use POSIX "strftime"; use CGI qw(:standard escapeHTML); use JSON; - sub writelog { my ($msg) = @_; @@ -19,8 +18,6 @@ sub writelog { close(LOG); } -writelog "Postpush."; - my $postdata = from_json(param('POSTDATA')); my $url = $postdata->{'repository'}->{'url'}; @@ -32,13 +29,21 @@ my $repo = $url; $repo =~ s'^.*\/''; #my $repo="repo"; my $branch="branch"; my $name="name"; -writelog "Repository $repo, branch $branch, name $name."; +writelog "Post push github web hook for repository $repo, branch $branch, name $name."; + + +my $child = fork; +if (not defined $child) {die "Fork failed.";} +if ($child) { + # parent process + writelog "Started ssh, pid = $child."; +} else { + # child process + exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"'; + exit; +} print header(), start_html("Vishap Oberon github post push web hook."), p("Repository $repo, branch $branch, name $name."), end_html(); - -system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &'; - -writelog "Buildall triggered."