Browse Source

add php/sh scripts to show build status

master
max.mehl 4 years ago
parent
commit
538fd345f9
Signed by: mxmehl GPG Key ID: 2704E4AB371E2E92
  1. 8
      fsfe-build.php
  2. 22
      fsfe-build.sh

8
fsfe-build.php

@ -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

@ -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"
Loading…
Cancel
Save