-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorb-for-builds
executable file
·48 lines (46 loc) · 1.02 KB
/
orb-for-builds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#
# Set a Google Microorb alight with the status of the set of specs
# for which a Travis build exists.
#
# Requires that travis CLI is installed, and that you are logged into Travis.
#
# Travis CLI: https://github.com/travis-ci/travis.rb
#
# Uses the microorb tool: apt install microorb-tool
#
# TODO: figure out how to only get status from the master branch.
#
GREEN='microorb 21F000'
RED='microorb EE0000'
failures=0
for file in */.travis.yml; do
dir=$(dirname $file)
url=$(cd $dir; git remote get-url origin)
# echo $dir $url
repo=$(echo $url | sed -e 's/^[email protected]:\(.*\)\.git$/\1/')
# Some repos aren't accessible. Only look at w3c ones.
case "$repo" in
w3c/mediacapture-depth)
echo "Skipping $repo"
;;
w3c/*)
# echo $repo
if travis status -r $repo -x > /dev/null; then
# Good status, no action.
true
else
echo "$repo bad"
failures=1
fi
;;
*)
# echo "Skipping $url"
;;
esac
done
if [ "$failures" != "0" ]; then
$RED
else
$GREEN
fi