Build machine to pick up latest buildall.pl every time.

This commit is contained in:
David Brown 2016-07-01 15:32:18 +01:00
parent ec7888859c
commit c7984ffdac
2 changed files with 12 additions and 10 deletions

View file

@ -42,6 +42,7 @@ sub logged {
} }
unlink glob "log/*";
for my $machine (sort keys %machines) { for my $machine (sort keys %machines) {
my ($login, $sudo, $dir) = @{$machines{$machine}}; my ($login, $sudo, $dir) = @{$machines{$machine}};
@ -53,7 +54,7 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";}
# # All builds have completed. Now scan the logs for pass/fail and build the passing report. # # All builds have completed. Now scan the logs for pass/fail and build the passing report.
# #
# my %status = (); # my %status = ();
# open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log."; # open(my $logs, "/tmp/buildall.log") // die "Couldn't open combined build log.";
# while (<$logs>) { # while (<$logs>) {
@ -62,23 +63,23 @@ while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";}
# } # }
# } # }
# close(my $logs); # close(my $logs);
# #
# #
# sub svgtext { # sub svgtext {
# my ($f, $x, $y, $msg) = @_; # my ($f, $x, $y, $msg) = @_;
# print($f "<text x=\"$x\" y=\"$y\" font-family=\"Verdana\" font-size=\"18\" font-fill=\"black\">"; # print($f "<text x=\"$x\" y=\"$y\" font-family=\"Verdana\" font-size=\"18\" font-fill=\"black\">";
# print($f $msg); # print($f $msg);
# print($f "</text>\n"); # print($f "</text>\n");
# } # }
# #
# #
# open(my $svg, ">passing.svg") // dir "Could not create passing.svg."); # open(my $svg, ">passing.svg") // dir "Could not create passing.svg.");
# print $svg '<svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1">\n'; # print $svg '<svg width="10cm" height="3cm" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1">\n';
# #
# my $i=1; # my $i=1;
# for my $host (sort keys %status) { # for my $host (sort keys %status) {
# svgtext($svg, 10, $i*20, $host); # svgtext($svg, 10, $i*20, $host);
# $i++; # $i++;
# } # }
# #
# print $svg '</svg>\n'; # print $svg '</svg>\n';

View file

@ -11,7 +11,7 @@ use JSON;
sub writelog { sub writelog {
my ($msg) = @_; my ($msg) = @_;
open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log"; open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log";
flock(LOG, 2) or die "Could not lock postpush.log"; flock(LOG, 2) or die "Could not lock postpush.log";
print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg);
@ -40,9 +40,10 @@ if ($child) {
} else { } else {
# child process # child process
close(STDIN); close(STDOUT); close(STDERR); close(STDIN); close(STDOUT); close(STDERR);
exec 'perl /var/lib/nethserver/ibay/githubhook/buildall.pl >/tmp/buildall.log'; system 'wget https://raw.githubusercontent.com/vishaps/voc/v2docs/src/tools/make/buildall.pl';
exec 'perl buildall.pl >/tmp/buildall.log';
exit; exit;
} }
print header(), print header(),
start_html("Vishap Oberon github post push web hook."), start_html("Vishap Oberon github post push web hook."),