re base code
[sdc.git] / ui-ci / src / main / resources / ci / scripts / sendMail.sh
1 #!/bin/bash
2
3 now=$(date +'%Y%-m%d%H%M')
4
5 REPORT_NAME=$1
6 VERSION=$2
7 ENV=$3
8
9 RECIPIENTS1="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
10 #RECIPIENTS2="dl-asdcqa@att.com"
11 RECIPIENTS2="md9897@att.com,NETCOM_ASDC_DEV@att.com,IL-D2-QA-Alex@att.com,bs5719@att.com,yg356h@att.com,yr9970@att.com,sl615n@att.com,yn813h@att.com,as221v@att.com,ms172g@att.com,ma2244@att.com,el489u@att.com,gg980r@att.com,ak991p@att.com,bv095y@att.com,ms656r@att.com,df502y@att.com,bt750h@att.com,ln699k@att.com,hm104p@att.com"
12
13 source ExtentReport/versions.info
14 if [ -z "$REPORT_NAME" ]
15  then
16         source ExtentReport/versions.info
17         now=$(date +'%Y-%m-%d_%H_%M')
18         REPORT_NAME="${now}"
19         VERSION="${osVersion}"
20                
21
22 fi
23
24 if [[ $env == *"DEV20"* ]]
25     then
26          ENV="Nightly"
27          RECIPIENTS=$RECIPIENTS1
28     else
29          ENV=""
30          RECIPIENTS=$RECIPIENTS2
31 fi
32
33 #REPORT_ZIP_FILE=ExtentReport_${now}.zip
34 REPORT_FOLDER='ExtentReport'
35 REPORT_HTML_FILE=${REPORT_FOLDER}/*Report.html
36 BODY_MESSAGE='Hello, \n\n Please find automation results on following link: \n\n http://asdc-srv-210-45.tlv.intl.att.com/'${ENV}'/'${VERSION}'/UI/'${REPORT_NAME}'/SDC_UI_Extent_Report.html \n\nThanks, \nASDC QA Team\n\n '
37
38 #OLD_FILE=$(find ./ -type f -name ${REPORT_ZIP_FILE} -print)
39 #if [ ! -z ${OLD_FILE} ]
40 #then
41 #        rm -f ${REPORT_ZIP_FILE}
42 #        echo "Removing old zip file............"
43 #fi
44
45 #echo "Creating new zip file"
46 #zip -r ${REPORT_ZIP_FILE} ./${REPORT_FOLDER}
47
48
49
50 echo -e ${BODY_MESSAGE} | mail -s 'E2E Automation '$ENV' results - SDC '$VERSION -r 'ASDC@Automation.team' $RECIPIENTS