Git push webhook script beginning to work. Fiddle with readme.

This commit is contained in:
David Brown 2016-06-26 17:07:40 +01:00
parent d8e26c635e
commit a5a8809b91
4 changed files with 46 additions and 63 deletions

View file

@ -1,14 +1,23 @@
### Vishap Oberon
### 𝓥ishap Ѵishap Ꮙishap Oberon
[ⱱishap Oberon Compiler](http://oberon.vishap.am) (voc) is a free (GPLv3) professional oberon-2 compiler.
Oberon is both a computer language, an operating system and a graphical
user interface. Originally designed and implemented by by Niklaus Wirth and
Jürg Gutknecht at ETH Zürich in the late 1980s, it demonstrates that the
fundamentals of a modern OS and GUI can be implemented in clean and simple code
orders of magnitude smaller than found in contemporary systems.
[𝓥ishap ⱱishap Ꮙishap Oberon](http://oberon.vishap.am) is a free and open source (GPLv3)
implementation of the Oberon-2 language compiler and libraries for use on
current operating systems such as Linux, BSD, Android, Mac and Windows.
-- or --
The Oberon language is the logical evolution of the Pascal and Modula languages,
following the principals of Einstein and Antoine de Saint-Exupéry:
### Ѵishap -- Ꮙishap -- 𝓥ishap
Ѵishap -- Ꮙishap -- 𝓥ishap
> Make it as simple as possible, but not simpler. (A. Einstein)
> Perfection is finally attained not when there is no longer anything to add, but
> when there is no longer anything to take away. (Antoine de Saint-Exupéry,
> Terre des Hommes, 1939, translated by Lewis Galantière.)
#### Licensing

View file

@ -51,21 +51,3 @@ for my $machine (sort keys %machines) {
while ((my $pid = wait) > 0) {print "Child pid $pid completed.\n";}
print "Buildall complete.\n";
exit;
#branch=v2docs
#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" &
#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" &
#for MACHINE in "${!VOCLOGIN[@]}"
#do
#SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch"
#PULL="${VOCSUDO[$MACHINE]} git pull"
#MAKE="${VOCSUDO[$MACHINE]} make full"
#ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log &
#done

View file

@ -1,39 +0,0 @@
#branch=v2docs
#ssh pi@pie "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@dcb "cd projects/oberon/vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@nas-ub64 "cd vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh dave@lub32 "cd vishap/voc && sudo git checkout $branch && sudo make clean" &
#ssh root@nas-ob32 "cd vishap/voc && git checkout $branch && make clean" &
#ssh root@oberon "cd vishap/voc && git checkout $branch && make clean" &
declare -A VOCLOGIN
VOCLOGIN[pi]=pi@pie
VOCLOGIN[darwin]=dave@dcb
VOCLOGIN[ub64]=dave@nas-ub64
VOCLOGIN[lub32]=dave@lub32
VOCLOGIN[ob32]=root@nas-ob32
VOCLOGIN[fb64]=root@oberon
declare -A VOCDIR
VOCDIR[pi]=projects/oberon/vishap/voc
VOCDIR[darwin]=projects/oberon/vishap/voc
VOCDIR[ub64]=vishap/voc
VOCDIR[lub32]=vishap/voc
VOCDIR[ob32]=vishap/voc
VOCDIR[fb64]=vishap/voc
declare -A VOCSUDO
VOCSUDO[pi]="sudo "
VOCSUDO[darwin]="sudo "
VOCSUDO[ub64]="sudo "
VOCSUDO[lub32]="sudo "
VOCSUDO[ob32]=""
VOCSUDO[fb64]=""
for MACHINE in "${!VOCLOGIN[@]}"
do
SETBRANCH="${VOCSUDO[$MACHINE]} git checkout $branch"
PULL="${VOCSUDO[$MACHINE]} git pull"
MAKE="${VOCSUDO[$MACHINE]} make full"
ssh ${VOCLOGIN[$MACHINE]} "cd ${VOCDIR[$MACHINE]} && $SETBRANCH && $PULL && $MAKE" | perl -pe "use POSIX strftime; print strftime \"%H:%M:%S $MACHINE: \", localtime" | tee log/$MACHINE.log &
done

View 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);