From: Marjan Schiller Date: Wed, 12 Jun 2013 14:42:04 +0000 (+0200) Subject: Added autotest mail script. X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=5df4daacebaa6f8901f61bbfc2145c9753ff2de8;p=profitbricks%2Fjenkins-build-scripts.git Added autotest mail script. --- diff --git a/autotest_result_mail.sh b/autotest_result_mail.sh new file mode 100755 index 0000000..3709c76 --- /dev/null +++ b/autotest_result_mail.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# copyright 2012-2013 Holger Levsen +# GPL2 licenced + +set -e +#set -x +export +echo + +# +# check if mail should be sent +# +if [ ${AUTOTEST_SEND_RESULT_MAIL} == "false" ]; then + echo "No result mail will be send." +fi + +# +# check if we have a LIVEBOOT_BUILD_NUMBER +# +if [ "$LIVEBOOT_BUILD_NUMBER" != "" ] ; then + echo "Ok, got LIVEBOOT_BUILD_NUMBER=$LIVEBOOT_BUILD_NUMBER, which is valid." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +if [ "$AUTOTEST_MAIL_CONTENT" != "" ] ; then + echo "Ok, got AUTOTEST_MAIL_CONTENT." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +# Replace the place holders +BUILD_NUMBER_TOKEN="" +MAIL_CONTENT=`echo ${$AUTOTEST_MAIL_CONTENT//$BUILD_NUMBER_TOKEN/$LIVEBOOT_BUILD_NUMBER}` + +echo $MAIL_CONTENT +exit 0 + +# +# send announcement mail +# +cat $MAIL_CONTENT | /usr/sbin/sendmail -t +echo +echo "Ok, announcement mail sent." + +# +# finish +# +figlet Ok +