add php/sh scripts to show build status

This commit is contained in:
2018-05-15 08:30:24 +02:00
parent 01ed78613c
commit 538fd345f9
2 changed files with 30 additions and 0 deletions

8
fsfe-build.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
$command = "/bin/bash fsfe-build.sh https://status.fsfe.org/fsfe.org";
// Execute command and give output
$output = shell_exec($command);
echo "$output";
?>

22
fsfe-build.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
WEB=$1
TMP=.status.tmp
wget -qO $TMP $WEB
STATUS=$(grep "Termination Status" $TMP | perl -pe "s/.*\<dd\>(.+)\<.*/\1/"
)
REV=$(grep "Updating " $TMP | grep -Eo "[[:alnum:]]{7}\.\.[[:alnum:]]{7}")
if [ "$STATUS" == "Success" ]; then
STATUS="fin"
elif [ "$STATUS" == "running..." ]; then
STATUS="run"
fi
if [ "$REV" = "" ]; then
REV="(uncond)"
fi
echo "$STATUS;r$REV"