Rev 4894 | Rev 7229 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bashFROMEMAIL="build@shop2020.in"FROMPASSWORD="cafe@nes"TOEMAIL="mandeep.dhir@shop2020.in,rajveer.singh@shop2020.in,pankaj.kankar@shop2020.in,anupam.singh@shop2020.in"MESSAGE=""FILE="/var/log/build.log"build(){/opt/apache-maven-3.0.3/bin/mvn clean install -P minify -Ddomain.name=saholic.com -Denv=prod >>$FILE 2>&1;OUT=$?if [ $OUT -eq 0 ];thenbuildpythonpackageselseMESSAGE="Maven build failed"sendmailfi}buildpythonpackages(){cd /root/code/trunk/PyProj/src;python setup.py bdist_egg;OUT=$?if [ $OUT -eq 0 ];thencopycontentelseMESSAGE="Python egg packing failed"sendmailfi}copycontent(){cd /root/code/trunk/runutils;./copy-wars-to-production.sh >>$FILEOUT=$?if [ $OUT -eq 0 ];thenMESSAGE="Build process completed"elseMESSAGE="Copying content failed"fisendmail}sendmail(){if [ $OUT -eq 0 ];thenSUBJECT="Build Successful"elseSUBJECT="Build failed"fisendEmail -f "$FROMEMAIL" -s smtp.gmail.com:587 -xu "$FROMEMAIL" -xp "$FROMPASSWORD" -t $TOEMAIL -o tls=yes -u "$SUBJECT" -m "$MESSAGE" -a $FILE}cd /root/code/trunk;svn up;OUT=$?if [ $OUT -eq 0 ];thenbuildelseMESSAGE="Svn update failed"sendmailfi