Checkin real (not merged) postpush.pl

This commit is contained in:
David C W Brown 2016-06-27 20:46:43 +01:00
parent a15f943d5b
commit 99bd3b3105

View file

@ -18,17 +18,6 @@ sub writelog {
close(LOG); close(LOG);
} }
sub writelog {
my ($msg) = @_;
open(LOG, ">>/tmp/postpush.log") or die "Could not create 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);
close(LOG);
}
writelog "Postpush.";
my $postdata = from_json(param('POSTDATA')); my $postdata = from_json(param('POSTDATA'));
my $url = $postdata->{'repository'}->{'url'}; my $url = $postdata->{'repository'}->{'url'};
@ -40,9 +29,9 @@ my $repo = $url; $repo =~ s'^.*\/'';
#my $repo="repo"; my $branch="branch"; my $name="name"; #my $repo="repo"; my $branch="branch"; my $name="name";
<<<<<<< HEAD
writelog "Post push github web hook for repository $repo, branch $branch, name $name."; writelog "Post push github web hook for repository $repo, branch $branch, name $name.";
my $child = fork; my $child = fork;
if (not defined $child) {die "Fork failed.";} if (not defined $child) {die "Fork failed.";}
if ($child) { if ($child) {
@ -53,18 +42,8 @@ if ($child) {
exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"'; exec 'ssh root@oberon "perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &"';
exit; exit;
} }
=======
writelog "Repository $repo, branch $branch, name $name.";
>>>>>>> 3a17e1a65685db28158fd65fff295e93a1bec31f
print header(), print header(),
start_html("Vishap Oberon github post push web hook."), start_html("Vishap Oberon github post push web hook."),
p("Repository $repo, branch $branch, name $name."), p("Repository $repo, branch $branch, name $name."),
end_html(); end_html();
<<<<<<< HEAD
=======
system 'ssh root@oberon perl vishap/voc/src/tools/testcoordinator/buildall.pl >/tmp/buildall.log &';
writelog "Buildall triggered."
>>>>>>> 3a17e1a65685db28158fd65fff295e93a1bec31f