File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -134,14 +134,20 @@ if [ ${NO_LOGS} -eq 1 ]; then
134
134
fi
135
135
136
136
# email notification with attaching the produced reports
137
- DATE=$( date +" %Y-%m-%d" ) # Get the current date
138
137
LOGS=" ${ROOTDIR} /logs"
139
138
REPORTS=" ${ROOTDIR} /reports"
140
139
141
- logfile=$( ls -t ${LOGS} | egrep " ${DATE} .*${IDENTIFIER} " | head -1)
142
- reportfile=$( ls -t ${REPORTS} | egrep " ${DATE} .*${IDENTIFIER} " | head -1)
143
- diffnum=$( ls -t ${REPORTS} | egrep " ${DATE} .*${IDENTIFIER} " | head -1 | cut -d' _' -f6)
144
- changes=${diffnum: 0: 1}
140
+ logfile=$( ls -t ${LOGS} | egrep " ${IDENTIFIER} " | head -1)
141
+ logfile_timestamp=${logfile: 0: 19}
142
+ reportfile=$( ls -t ${REPORTS} | egrep " ${logfile_timestamp} -${IDENTIFIER} " | head -1)
143
+ if [ -z $reportfile ]; then
144
+ echo " No report file found. Exiting."
145
+ exit $?
146
+ else
147
+ echo " Found report file: ${reportfile} "
148
+ fi
149
+
150
+ changes=$( echo ${reportfile} | rev | cut -d' _' -f1 | rev | cut -d' .' -f1)
145
151
146
152
(echo " Changes since the last time: ${changes} " ; uuencode " ${LOGS} /${logfile} " " ${logfile} " ; uuencode " ${REPORTS} /${reportfile} " " ${reportfile} " ) \
147
153
| mail -s " Selenium Tests Report: ${IDENTIFIER} ${email_date} Changes: ${changes} " ${EMAIL}
You can’t perform that action at this time.
0 commit comments