Skip to content

Commit

Permalink
Merge pull request #678 from kees/badge-cache
Browse files Browse the repository at this point in the history
badge-caching: Add the SVG templates and the refresh script
  • Loading branch information
JustinStitt committed Jan 9, 2024
2 parents 032d512 + 0a9675e commit 01ce77b
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/badge-caching/failing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions scripts/badge-caching/passing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions scripts/badge-caching/refresh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

BASE="/var/www/html/cbl/badges"
cd "$BASE"

wget -q -N https://clangbuiltlinux.github.io/ -Odump.txt
for svg in $(sed -e 's/"/\n/g' dump.txt | grep 'actions/workflows.*yml$' | sort -u); do
#break
wget -q -N -r "$svg"/badge.svg
sleep 1
done

BUILDS="github.com/clangbuiltlinux/continuous-integration2/actions/workflows"
for yml in $(cd "$BUILDS" && echo *); do
build=$(basename $yml .yml)
badge="$BUILDS/$yml/badge.svg"
if grep -q passing "$badge"; then
ln -sf passing.svg $build.svg
else
ln -sf failing.svg $build.svg
fi
done

0 comments on commit 01ce77b

Please sign in to comment.