X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=buildSite.sh;h=8f60658f335785167b644908e650fef802f835e8;hb=bd1d7fdf6f73a34bf4f8f5e672186e2f8fe7f46c;hp=60e393273503a2741016889570fc1aa6d302bdbd;hpb=89a97bfb16f2f2a0e93d743148fbbe882a31a06b;p=gpl%2Fargeo-slc.git diff --git a/buildSite.sh b/buildSite.sh index 60e393273..8f60658f3 100755 --- a/buildSite.sh +++ b/buildSite.sh @@ -12,20 +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 -up --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 -up --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