projects
/
grml-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix capitalization of project name in GRML/index.html
[grml-live.git]
/
buildd
/
functions.sh
diff --git
a/buildd/functions.sh
b/buildd/functions.sh
index
04d2eb1
..
a960d6f
100755
(executable)
--- a/
buildd/functions.sh
+++ b/
buildd/functions.sh
@@
-1,4
+1,4
@@
-#!/bin/
ba
sh
+#!/bin/sh
# Filename: /usr/share/grml-live/buildd/functions.sh
# Purpose: main function file for grml-live buildd
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Filename: /usr/share/grml-live/buildd/functions.sh
# Purpose: main function file for grml-live buildd
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
@@
-20,13
+20,14
@@
which mutt >/dev/null 2>&1 || die "mutt binary not found. Exiting."
[ -n "$SUITE" ] || die "\$SUITE is not set. Exiting."
[ -n "$CLASSES" ] || die "\$CLASSES is not set. Exiting."
[ -n "$NAME" ] || die "\$NAME is not set. Exiting."
[ -n "$SUITE" ] || die "\$SUITE is not set. Exiting."
[ -n "$CLASSES" ] || die "\$CLASSES is not set. Exiting."
[ -n "$NAME" ] || die "\$NAME is not set. Exiting."
-[ -n "$
ISO_NAME" ] || die "\$ISO
_NAME is not set. Exiting."
+[ -n "$
PRODUCT_NAME" ] || die "\$PRODUCT
_NAME is not set. Exiting."
# some defaults:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
DATE=$(date +'%Y%m%d_%H%M%S')
TMP_DIR="$(mktemp -d)"
[ -n "$TMP_DIR" ] || die "Could not create \$TMP_DIR. Exiting."
# some defaults:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
DATE=$(date +'%Y%m%d_%H%M%S')
TMP_DIR="$(mktemp -d)"
[ -n "$TMP_DIR" ] || die "Could not create \$TMP_DIR. Exiting."
+ISO_NAME="${PRODUCT_NAME}.iso"
# make sure we have same safe defaults:
[ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$"
# make sure we have same safe defaults:
[ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$"
@@
-34,7
+35,7
@@
TMP_DIR="$(mktemp -d)"
[ -n "$RECIPIENT" ] || RECIPIENT=root@localhost
[ -n "$FROM" ] || FROM=root@localhost
[ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
[ -n "$RECIPIENT" ] || RECIPIENT=root@localhost
[ -n "$FROM" ] || FROM=root@localhost
[ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
-
ATTACHMENT="$TMP_DIR/grml-live-logs_$DATE.tar.gz
"
+
MIRROR_LOG_PATH="logs/${PRODUCT_NAME}_${DATE}
"
if [ -n "$LOGFILE" ] ; then
GRML_LOGFILE="$LOGFILE"
if [ -n "$LOGFILE" ] ; then
GRML_LOGFILE="$LOGFILE"
@@
-66,10
+67,12
@@
grml_live_run() {
grml_name="$NAME-daily-$CODENAME"
shortdate="$(date +%y%m%d)"
grml_name="$NAME-daily-$CODENAME"
shortdate="$(date +%y%m%d)"
+ TIME_START=$(date +%s)
grml-live -F $* -a $ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \
-g "$grml_name" -v "$shortdate" -r grml-live-autobuild -i $ISO_NAME \
grml-live -F $* -a $ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \
-g "$grml_name" -v "$shortdate" -r grml-live-autobuild -i $ISO_NAME \
- >/var/log/grml-buildd.stdout \
- 2>/var/log/grml-buildd.stderr ; RC=$?
+ >/var/log/grml-buildd.log 2>&1 ; RC=$?
+ TIME_END=$(date +%s)
+ WALLTIME=$(($TIME_END-$TIME_START))
if [ "$RC" = "0" ] ; then
RC_INFO=success
if [ "$RC" = "0" ] ; then
RC_INFO=success
@@
-79,16
+82,11
@@
grml_live_run() {
fi
}
fi
}
-# create log archive:
-create_logs() {
- ( cd / && tar zcfh $ATTACHMENT $FAI_LOGFILES /var/log/grml-buildd.stderr /var/log/grml-buildd.stdout $GRML_LOGFILE >/dev/null )
-}
-
# store logs on remote server:
upload_logs() {
[ -n "$RSYNC_MIRROR" ] || return 1
# store logs on remote server:
upload_logs() {
[ -n "$RSYNC_MIRROR" ] || return 1
- rsync --exclude dmesg.log --times --partial --copy-links -rltDz --quiet /var/log/grml-buildd.
*
\
- $FAI_LOGFILES
$GRML_LOGFILE $RSYNC_MIRROR/logs/"${NAME}_${DATE}"
/
+ rsync --exclude dmesg.log --times --partial --copy-links -rltDz --quiet /var/log/grml-buildd.
log
\
+ $FAI_LOGFILES
/* $GRML_LOGFILE $RSYNC_MIRROR/$MIRROR_LOG_PATH
/
}
# store information of ISO size:
}
# store information of ISO size:
@@
-102,17
+100,12
@@
iso_details() {
# send status mail:
send_mail() {
# send status mail:
send_mail() {
- # create logs if using 'send_mail -e'
- [ "$1" = "-e" ] && create_logs
-
- # attach logs only if we have some:
- [ -r "$ATTACHMENT" ] && MUTT_ATTACH="-a $ATTACHMENT" || MUTT_ATTACH=''
+ echo "$ISO_DETAILS
- echo -en "Automatically generated mail by $SCRIPTNAME
+Return code of grml-live was: $RC
+Time: $WALLTIME
-$ISO_DETAILS
-
-Return code of grml-live run was: $RC
+Full logs at: $MIRROR_URL/$MIRROR_LOG_PATH/
$(grep -A2 'Executed grml-live' $GRML_LOGFILE || echo "* executed grml-live command line not available")
$(grep -A2 'Executed grml-live' $GRML_LOGFILE || echo "* executed grml-live command line not available")
@@
-120,11
+113,15
@@
$(grep -A2 'Executed FAI' $GRML_LOGFILE || echo "* executed FAI command line not
The following errors have been noticed (several might be warnings only):
The following errors have been noticed (several might be warnings only):
-$(grep -i error $FAI_LOGFILES/* /var/log/grml-buildd.std* | grep -ve liberror -ve libgpg-error || echo "* nothing")
+$(grep -i error $FAI_LOGFILES/*.log /var/log/grml-buildd.log | grep -ve liberror -ve libgpg-error -ve libcomerr -ve 'no errors found' || echo "* nothing")
+
+The following errors have been noticed in FAI scripts:
+
+$(grep -B2 "FAILED with exit code" $FAI_LOGFILES/* | echo "* nothing")
The following warnings have been noticed:
The following warnings have been noticed:
-$(grep -i warn $FAI_LOGFILES/* /var/log/grml-buildd.
std*
|| echo "* nothing")
+$(grep -i warn $FAI_LOGFILES/* /var/log/grml-buildd.
log
|| echo "* nothing")
There following dependency problems have been noticed:
There following dependency problems have been noticed:
@@
-134,11
+131,13
@@
The following packages could not be installed:
$(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\(.*\)"\(.*\)/\2/' | sort -u || echo "* nothing")
$(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\(.*\)"\(.*\)/\2/' | sort -u || echo "* nothing")
-See
attached file
s for further details.
+See
full log
s for further details.
-EOF" | \
- mutt -e "my_hdr From: grml-live autobuild daemon <$FROM>" -s "$SCRIPTNAME [${DATE}] - $RC_INFO" \
- -a /var/log/grml-buildd.stderr $MUTT_ATTACH -- "$RECIPIENT"
+--" "
+Automatically generated mail by $SCRIPTNAME
+" | \
+ mutt -e "my_hdr From: grml-live autobuild daemon <$FROM>" -s "$PRODUCT_NAME - $RC_INFO" \
+ -a /var/log/grml-buildd.log -- "$RECIPIENT"
}
# make sure we store the final iso:
}
# make sure we store the final iso:
@@
-158,9
+157,8
@@
store_iso() {
# allow clean exit:
bailout() {
if [ "$RC" = "0" ] ; then
# allow clean exit:
bailout() {
if [ "$RC" = "0" ] ; then
- rm -rf "$
ATTACHMENT" "$
TMP_DIR" "$OUTPUT_DIR"
+ rm -rf "$TMP_DIR" "$OUTPUT_DIR"
else
else
- rm -f "$ATTACHMENT"
echo "building ISO failed, keeping build files [${OUTPUT_DIR} / ${TMP_DIR}]">&2
fi
echo "building ISO failed, keeping build files [${OUTPUT_DIR} / ${TMP_DIR}]">&2
fi