From dbb3a75a5f264ea980718a8b027b30da3c02f8f2 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Sat, 6 Jun 2009 21:39:46 +0000 Subject: [PATCH] Add exit status git-svn-id: https://svn.argeo.org/slc/trunk@2506 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- buildSite.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/buildSite.sh b/buildSite.sh index 09408cf00..f35c0817b 100755 --- a/buildSite.sh +++ b/buildSite.sh @@ -12,10 +12,13 @@ PROFILES=$1 BUILD_DIR=`pwd` HOSTNAME=`hostname -f` DATE=`date -u` +EXIT_STATUS=0 # BUILD mvn --fail-at-end deploy $PROFILES 2>&1 | tee deploy.log -if [ $? eq 0 ] ; then +EXIT_STATUS=$? +if [ $EXIT_STATUS eq 0 ] +then mail -s "Build@$HOSTNAME SUCCESS - $DATE - $BUILD_DIR" $TO < pom.xml else mail -s "Build@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < deploy.log @@ -23,9 +26,11 @@ fi # SITE mvn --fail-at-end site-deploy $PROFILES 2>&1 | tee siteGeneration.log -if [ $? eq 0 ] ; then +if [ $? eq 0 ] +then echo No need to send email for successful site generation else mail -s "SiteGeneration@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < siteGeneration.log fi +exit $EXIT_STATUS \ No newline at end of file -- 2.39.2