]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - buildSite.sh
First tests of XMPP
[gpl/argeo-slc.git] / buildSite.sh
index b3fa4e10e4acad34bed3417fef8af158a023f49f..b84173dea55813dc4cde858c20f6cdb07bf5704c 100755 (executable)
@@ -12,22 +12,25 @@ PROFILES=$1
 BUILD_DIR=`pwd`
 HOSTNAME=`hostname -f`
 DATE=`date -u`
+EXIT_STATUS=0
 
 # BUILD
-mvn --fail-at-end deploy -P$PROFILES 2>&1 | tee deploy.log
-
-if [ $? != "0" ] ; then
-       mail -s "Build@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < deploy.log
-else
+mvn --fail-at-end deploy $PROFILES 2>&1 | tee deploy.log
+EXIT_STATUS=$PIPESTATUS
+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
 fi
 
 # SITE
-mvn --fail-at-end site-deploy -P$PROFILES 2>&1 | tee siteGeneration.log
-
-if [ $? != "0" ] ; then
-       mail -s "SiteGeneration@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < siteGeneration.log
+mvn --fail-at-end site-deploy $PROFILES 2>&1 | tee siteGeneration.log
+if [ $PIPESTATUS -eq 0 ]
+then
+       echo No need to send email for successful site generation
 else
-       # No need to send email for successful site generation
+       mail -s "SiteGeneration@$HOSTNAME FAILURE - $DATE - $BUILD_DIR" $TO < siteGeneration.log
 fi
 
+exit $EXIT_STATUS