|
1 | | -#!/bin/sh |
| 1 | +#!/bin/bash |
2 | 2 |
|
3 | | -PERLLIB=autobuild |
4 | | -export PERLLIB |
5 | | -OUTPUTDIR=/export/web/www/scoreboard |
6 | | -export OUTPUTDIR |
7 | | -CONFIGDIR=$HOME/scoreboard |
8 | | -export CONFIGDIR |
| 3 | +set -ue |
9 | 4 |
|
10 | | -cd $HOME/scoreboard |
11 | | -git pull |
12 | | -cd $HOME/autobuild |
| 5 | +OUTPUT="${OUTPUT:-/export/web/www/scoreboard}" |
| 6 | +if ! [ -d "$OUTPUT" ] |
| 7 | +then |
| 8 | + echo "\$OUTPUT directory ($OUTPUT) does not exist" |
| 9 | + exit 1 |
| 10 | +fi |
| 11 | + |
| 12 | +SCOREBOARD_ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
| 13 | +cd "$SCOREBOARD_ROOT" |
13 | 14 | git pull |
14 | 15 |
|
15 | | -# Generate the index page! |
16 | | -/usr/bin/perl ./scoreboard.pl -v -d $OUTPUTDIR -i $CONFIGDIR/index.xml 2>&1 & |
17 | | -# Generate other pages! |
18 | | -/usr/bin/perl ./scoreboard.pl -b -d $OUTPUTDIR -f $CONFIGDIR/ace.xml -o ace.html 2>&1 & |
19 | | -/usr/bin/perl ./scoreboard.pl -b -d $OUTPUTDIR -f $CONFIGDIR/ace6.xml -o ace6.html 2>&1 & |
20 | | -/usr/bin/perl ./scoreboard.pl -b -d $OUTPUTDIR -f $CONFIGDIR/tao.xml -o tao.html 2>&1 & |
21 | | -/usr/bin/perl ./scoreboard.pl -b -d $OUTPUTDIR -f $CONFIGDIR/tao2.xml -o tao2.html 2>&1 & |
| 16 | +AUTOBUILD_ROOT="${AUTOBUILD_ROOT:-$HOME/autobuild}" |
| 17 | +cd "$AUTOBUILD_ROOT" |
| 18 | +git pull |
22 | 19 |
|
23 | | -# Generate the test matrices! |
24 | | -##testmatrix/update_scoreboard.sh 2>&1 & |
| 20 | +groups=( |
| 21 | + ace |
| 22 | + ace6 |
| 23 | + tao |
| 24 | + tao2 |
| 25 | +) |
25 | 26 |
|
26 | | -# Generate integrated pages! |
27 | | -/usr/bin/perl ./scoreboard.pl -b -d /export/web/www/scoreboard -z -j $CONFIGDIR/ace.xml,$CONFIGDIR/ace6.xml,$CONFIGDIR/tao.xml,$CONFIGDIR/tao2.xml 2>&1 & |
| 27 | +# Generate the index page! |
| 28 | +/usr/bin/perl ./scoreboard.pl -v -d "$OUTPUT" -i "$SCOREBOARD_ROOT/index.xml" |
28 | 29 |
|
29 | | -#Generate build matrix |
30 | | -#/usr/bin/perl buildmatrix/buildmatrix.pl $CONFIGDIR/ace.xml $OUTPUTDIR 1 > /project/taotmp/scoreboard/buildmatrix/output.html 2> /tmp/build.out |
| 30 | +xml_files=() |
| 31 | +for group in ${groups[@]} |
| 32 | +do |
| 33 | + echo "Generating pages for $group..." |
| 34 | + xml_file="$SCOREBOARD_ROOT/$group.xml" |
| 35 | + xml_files+=("$xml_file") |
31 | 36 |
|
32 | | -#/usr/bin/perl buildmatrix/buildmatrix.pl $CONFIGDIR/tao.xml $OUTPUTDIR 1 > /project/taotmp/scoreboard/buildmatrix/tao.html 2> /tmp/build.out |
| 37 | + # Generate the normal pages for this group |
| 38 | + /usr/bin/perl ./scoreboard.pl -b -d "$OUTPUT" -f "$xml_file" -o "$group.html" -v |
33 | 39 |
|
34 | | -#Remove the obsolete db files and give the list of available db files. |
35 | | -##matrix_database/RemoveAndListCompilationDbFiles.sh |
| 40 | + # Generate the text matrix pages for this group |
| 41 | + ./matrix.py "${OUTPUT}" |
36 | 42 |
|
37 | | -# |
38 | | -wait |
| 43 | + # Remove the builds.json for this group |
| 44 | + rm "$OUTPUT/builds.json" |
| 45 | +done |
39 | 46 |
|
40 | | -exit 0 |
| 47 | +# Generate integrated pages! |
| 48 | +echo "Generating integrated pages..." |
| 49 | +function join_by { |
| 50 | + local d=${1-} f=${2-} |
| 51 | + if shift 2 |
| 52 | + then |
| 53 | + printf %s "$f" "${@/#/$d}" |
| 54 | + fi |
| 55 | +} |
| 56 | +/usr/bin/perl ./scoreboard.pl -b -d "$OUTPUT" -z -j "$(join_by , ${xml_files[@]})" |
0 commit comments