mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 13:22:26 +00:00
Git push webhook script beginning to work. Fiddle with readme.
This commit is contained in:
parent
d8e26c635e
commit
a5a8809b91
4 changed files with 46 additions and 63 deletions
31
src/tools/testcoordinator/postpush.pl
Normal file
31
src/tools/testcoordinator/postpush.pl
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
use CGI qw(:standard escapeHTML);
|
||||
use JSON;
|
||||
|
||||
|
||||
my $postdata = from_json(param('POSTDATA'));
|
||||
|
||||
my $url = $postdata->{'repository'}->{'url'};
|
||||
my $ref = $postdata->{'ref'};
|
||||
my $name = $postdata->{'head_commit'}->{'author'}->{'name'};
|
||||
|
||||
my $branch = $ref; $branch =~ s'^.*\/'';
|
||||
my $repo = $url; $repo =~ s'^.*\/'';
|
||||
|
||||
|
||||
print header(),
|
||||
start_html("Vishap Oberon github post push web hook."),
|
||||
p("Repository $repo, branch $branch, name $name."),
|
||||
end_html();
|
||||
|
||||
|
||||
open(LOG, ">>/tmp/postpush.log") or die "Could not create postpush.log";
|
||||
flock(LOG, 2) or die "Could not lock postpush.log";
|
||||
printf LOG "Repository $repo, branch $branch, name $name.";
|
||||
close(LOG);
|
||||
Loading…
Add table
Add a link
Reference in a new issue