Automatically check for syntax of scripts when building package.
[grml-unittests.git] / autoconfig / deploy.sh
1 #!/bin/zsh
2
3 . /etc/grml/autoconfig.functions
4
5 mkdir -p /tmp/tests
6
7 TESTS_SRC=$(getbootparam testsrc)
8 STATUS=$(getbootparam status)
9
10 if [ -n "$TESTS_SRC" ] ; then
11     cd /tmp/tests
12     wget -m -np -nd $TESTS_SRC/
13     cd -
14 fi
15
16 if [ -d /tmp/tests ] ; then
17     chmod +x /tmp/tests/*.sh
18 fi
19
20 TESTS=""
21 for file in /tmp/tests/*.sh ; do
22     PATH=/tmp/tests $file > /tmp/output.log
23     RETVAL=$?
24     [ "$RETVAL" -ne 0 ] && wget --post-file=/tmp/output.log $STATUS/FAIL
25     TESTS="$TESTS $file"
26
27 done
28 wget --post-data="Run $TESTS" $STATUS/DONE
29