add php/sh scripts to show build status
This commit is contained in:
8
fsfe-build.php
Normal file
8
fsfe-build.php
Normal 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
22
fsfe-build.sh
Executable 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"
|
||||||
Reference in New Issue
Block a user