]> rtime.felk.cvut.cz Git - nul-nightly.git/commitdiff
Move cron script here
authorNUL nighly testing <nul@compile.felk.cvut.cz>
Fri, 31 Jan 2014 13:58:01 +0000 (14:58 +0100)
committerNUL nighly testing <nul@compile.felk.cvut.cz>
Fri, 31 Jan 2014 13:58:01 +0000 (14:58 +0100)
cron.sh [new file with mode: 0755]

diff --git a/cron.sh b/cron.sh
new file mode 100755 (executable)
index 0000000..8ce3d03
--- /dev/null
+++ b/cron.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -e
+PATH=$HOME/bin:$PATH
+ret=0
+log=$(date '+nul_%F_%T.log')
+
+cd ~/nul
+umask 022
+
+git fetch --quiet
+git stash --quiet # Save any chnages made by humans e.g. some testing
+#git checkout --quiet master
+#git reset --quiet --hard origin/master
+git clean --quiet -fxd > /dev/null
+git submodule --quiet foreach --recursive 'git stash --quiet; git clean --quiet -fxd'
+git submodule --quiet update --init
+
+#if ! cmp $0 michal/wvtest/nul-nightly-cron.sh; then
+#    cp michal/wvtest/nul-nightly-cron.sh $0 && exec $0
+#fi
+
+cd ~/nul-nightly
+if nul-nightly.sh > $log 2>&1; then
+    ( cd ~/nul; git push --quiet -f origin master:tested ) || :
+else
+    ret=1
+    (
+#To: commits-nul@os
+       cat <<EOF
+Subject: NUL nightly build/test failed!
+To: sojkam1@fel.cvut.cz
+
+Full log can be found at compile.felk.cvut.cz:$PWD/$log
+
+EOF
+       export COLUMNS=100
+       cat $log | tr -d '\015' | wvformat --before-failure=10 | wvwrap #| iconv -f ASCII -t ASCII//IGNORE
+    ) | /usr/sbin/sendmail -ti
+fi
+
+git add $log
+git commit --quiet -m 'New nightly build log'
+
+make
+
+git push --quiet