summaryrefslogtreecommitdiffstats
path: root/hostTools/scripts/nightlybuild/voice/cxc_nbrt_ce_postprocess.sh
blob: 2689b218ab8b68f186f5408a7b33000f2b95c427 (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
126
127
128
129
#!/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_BASECC_LOG_PATH=$(cygpath -u "${CXNB_BASECC_LOCAL_LOG_PATH}")
export CXNB_BASECC_LOCAL_SRC_PATH=$(cygpath -u "${CXNB_BASECC_LOCAL_SRC_PATH}")

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

mkdir -p ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}
cd ${CXNB_BASECC_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_BASECC_SRC_PATH}/cablex_tools/dev/callagent/callagent.exe ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/
# cp -f -v ${CXNB_BASECC_SRC_PATH}/cablex_tools/dev/callagent/hhca.cfg ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/
cp -f -v ${CXNB_BASECC_SRC_PATH}/update*.updt ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/
cp -f -v ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/build*.log ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs/


if [ "${CXNB_CFG_SENDMAIL}" = "yes" ]
then
   appendFiles=
   attachments="build.log.gz cc_ce_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
   # NOTE: The following greps are dependent on the printouts 
   # for the Linux commands through the expect script lnx_nbrt_basic_cmds.exp
   total=`grep -c "The Linux command \"make PROFILE=9634.*GWV BRCM" buildlogs/build.log`
   fail=`grep -c "The Linux command \"make PROFILE=9634.*GWV BRCM.*failed" buildlogs/build.log`
   pass=`grep -c "The Linux command \"make PROFILE=9634.*GWV BRCM.*succeeded" buildlogs/build.log`
   echo "Total of $total DSL CommEngine apps built: $pass passed, $fail failed. " >>email.txt
   grep "The Linux command \"make PROFILE=9634.*GWV BRCM.*failed" buildlogs/build.log >>email.txt
   echo " " >>email.txt
   grep "The Linux command \"make PROFILE=9634.*GWV BRCM.*succeeded" buildlogs/build.log >>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_BASECC_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_BASECC_LOCAL_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs) >> email.txt
   # echo $(cygpath -w //${CXNB_BASECC_LOCAL_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/deps/buildlogs) >> email.txt
  
   #note: blat doesnt work from UNC directories so copy everything to a local directory

   echo "Finished postprocessing at: " `date +"%T"` >>${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs/build.log
   gzip ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/${cxcOsType}/buildlogs/build.log
   gzip ${CXNB_BASECC_LOG_PATH}/${CXNB_LABEL}/build.log

   for file in ${attachments}
   do
      cp -f ./../${file} .
   done

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

   blat email.txt -t ${recipients} -s "${CXNB_BASECC_PROJECT} Nightly Build results for ${CXNB_EMAIL_DATE}" ${attachList}
   rm -f ${attachments}
fi
 
exit