oops
[infrastructure.git] / scripts / daily-test-summary.sh
1 #!/bin/bash
2
3 # extract from testmaster's convenience tools
4 function today () { date +%Y.%m.%d; }
5 function manage () {
6   pushd ~/manage >& /dev/null; git pull ; ./LocalSubstrate.inria.py "$@" ; popd >& /dev/null
7 }
8
9 subject="Tests summary for $(today)"
10 to="build@onelab.eu"
11 buildhost="build.onelab.eu"
12 distro=onelab
13
14 function builds () { manage -tv | grep $(today) | cut -d ' ' -f 3 ; }
15 function add_links () {
16     for build in $(builds); do
17         echo $build | grep -q lxc && bdistro=lxc || bdistro=$distro
18         echo "http://$buildhost/$bdistro/$build/testlogs"
19     done
20 }
21
22 ( \
23     echo "Subject: ${subject}" ; \
24     echo "To: ${to}" ; \
25     cd ; \
26     echo "-------------------- Test results for $(today)" ; \
27     manage -tv | grep $(today) ; \
28     echo "-------------------- Shortcuts" ; \
29     add_links ; \
30 ) | sendmail ${to}