mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
* Mail notification of build failures.
svn path=/nixpkgs/trunk/; revision=570
This commit is contained in:
parent
be3479234b
commit
1fde9ff92d
@ -7,6 +7,8 @@ if ! rev=$(curl --silent -k https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/ \
|
||||
| sed 's/.*Revision \(.*\):.*/\1/'); \
|
||||
then exit 1; fi
|
||||
|
||||
echo "building revision $rev of $url"
|
||||
|
||||
echo $rev > head-revision.nix
|
||||
|
||||
if ! storeexprs=($(nix-instantiate -vvv do-it.nix)); then exit 1; fi
|
||||
|
33
nix-dist/mail-result.sh
Executable file
33
nix-dist/mail-result.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#! /bin/sh
|
||||
|
||||
email=$1
|
||||
shift
|
||||
|
||||
logfile=/tmp/logfile-$$ # !!! security
|
||||
trap "rm $logfile" EXIT
|
||||
|
||||
echo $logfile
|
||||
|
||||
if ! "$@" > $logfile 2>&1; then
|
||||
BLOCKER=/tmp/inhibit-notify
|
||||
if ! test -f $BLOCKER; then
|
||||
HEAD=`head $logfile`
|
||||
TAIL=`tail $logfile`
|
||||
bzip2 < $logfile > $logfile.bz2
|
||||
mail -s "Nix build failed" -a $logfile.bz2 $email <<EOF
|
||||
A Nix build failed. See the attached log file for details.
|
||||
|
||||
No further messages will be sent until the file $BLOCKER is removed.
|
||||
|
||||
The first few lines of the log are:
|
||||
|
||||
$HEAD
|
||||
|
||||
The last few lines are:
|
||||
|
||||
$TAIL
|
||||
EOF
|
||||
rm $logfile.bz2
|
||||
touch $BLOCKER
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user