summaryrefslogtreecommitdiffstats
path: root/hostTools/scripts/nightlybuild/voice/cxc_nbrt_postprocess.sh
blob: 95b6e2449305698ba9294e70b2575d263acc0d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
#------------------------------------------------------------------------------
# Broadcom Canada Ltd., Copyright 2001-2003
#
# Filename:  cxc_nbrt_postprocess.sh
# Purpose:   Postprocess the nightly build and test logs
#------------------------------------------------------------------------------

if [ -z "${CXNB_LABEL}" ]
then
   echo CXNB_LABEL not defined!
   exit
fi

cxcOsType=$1

export CXNB_LOG_PATH=$(cygpath -u "${CXNB_LOCAL_LOG_PATH}")
export CXNB_SRC_PATH=$(cygpath -u "${CXNB_LOCAL_SRC_PATH}")

echo "Postprocessing at: " `date +"%T"` >>${CXNB_LOG_PATH}/${CXNB_LABEL}/build.log

mkdir -p ${CXNB_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}
cd ${CXNB_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}

mkdir -p buildlogs
# mkdir -p deps/buildlogs
# mkdir -p debug
# mv -f *.map debug
# mv -f *_sym.bin debug
# mv -f *.txt buildlogs
# mv -f deps/*.txt deps/buildlogs

# cp -f -v ${CXNB_SRC_PATH}/cablex_tools/dev/callagent/callagent.exe ${CXNB_LOG_PATH}/${CXNB_LABEL}/
# cp -f -v ${CXNB_SRC_PATH}/cablex_tools/dev/callagent/hhca.cfg ${CXNB_LOG_PATH}/${CXNB_LABEL}/
cp -f -v ${CXNB_SRC_PATH}/update*.updt ${CXNB_LOG_PATH}/${CXNB_LABEL}/
cp -f -v ${CXNB_LOG_PATH}/${CXNB_LABEL}/build*.log ${CXNB_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs/


if [ "${CXNB_CFG_SENDMAIL}" = "yes" ]
then
   appendFiles=
   attachments="build.log cc_config_spec.txt"

   if [ "${CXNB_CFG_BUILD_GETSRC}" = "yes" ]
   then
      appendFiles="${appendFiles} buildlogs/buildconfig.log"
   fi  

   echo $appendFiles

   recipients="vmarkovski@broadcom.com,jnicol@broadcom.com"

   echo "------------------------------------------------------------------------">email.txt
   echo "CxC Nightly Build summary " >>email.txt
   echo "------------------------------------------------------------------------">>email.txt
   echo " " >>email.txt
   # total=`grep -c "cxc build" buildlogs/build_summary.txt`
   # fail=`grep -c FAILED buildlogs/build_summary.txt`
   # pass=`grep -c successfull buildlogs/build_summary.txt`
   # echo "Total of $total cxc apps built: $pass pass, $fail failed. " >>email.txt
   # echo " " >>email.txt
   # grep FAILED buildlogs/build_summary.txt >>email.txt
   # echo " " >>email.txt
   # grep successfull buildlogs/build_summary.txt >>email.txt
   # echo " " >>email.txt
    
   echo "------------------------------------------------------------------------">>email.txt
   echo "Nightly build auto-update activity " >>email.txt
   echo "------------------------------------------------------------------------">>email.txt
   echo " " >>email.txt
   grep "CC Config Spec" ./../build.log >> email.txt || echo "No config spec update." >> email.txt
   echo " " >>email.txt
 
   if [ -n "${appendFiles}" ]
   then
      for file in ${appendFiles}
      do
         if [ -e "${file}" ]
         then
            cat ${file} >> email.txt
         else
            echo "POSTPROCESSING ERROR: could not find ${file}!" >>email.txt
         fi
      done
   fi
   echo " " >>email.txt
 
   if [ -e "./../cc_config_spec.old" ]
   then
      attachments="${attachments} cc_config_spec.old"
   fi

   echo "------------------------------------------------------------------------">>email.txt
   echo "Nightly build images, logs and source code for ${CXNB_EMAIL_DATE}:" >> email.txt
   echo "------------------------------------------------------------------------">>email.txt
   echo "Last night's nightly build source code can be found at:" >> email.txt
   echo $(cygpath -w //${CXNB_LOCAL_SRC_PATH}) >> email.txt
   echo "Nightly build images can be found at" >> email.txt
   echo $(cygpath -w //${CXNB_BASECC_LOCAL_SRC_PATH}/images) >> email.txt
   # echo "Nightly build map files and symbol table images can be found at" >> email.txt
   # echo $(cygpath -w //${UNIX_TESTCOMPUTER}/cxnb/cxlogs/${CXNB_UCMCC_PROJECT}/${CXNB_LABEL}/${cxcOsType}/debug) >> email.txt
   echo "Nightly build logs can be found at" >> email.txt
   echo $(cygpath -w //${CXNB_LOCAL_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs) >> email.txt
   # echo $(cygpath -w //${CXNB_LOCAL_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/deps/buildlogs) >> email.txt
  
   #note: blat doesnt work from UNC directories so copy everything to a local directory
   for file in ${attachments}
   do
      cp -f ./../${file} .
   done

   attachList=""
   for file in ${attachments}
   do
      attachList="${attachList} -attacht ${file}"
   done

   blat email.txt -t ${recipients} -s "${CXNB_UCMCC_PROJECT} Nightly Build results for ${CXNB_EMAIL_DATE}" ${attachList}
   rm -f ${attachments}
fi
 
echo "Finished postprocessing at: " `date +"%T"` >>${CXNB_LOG_PATH}/${CXNB_LABEL}/build.log

exit