-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchecklog
executable file
·61 lines (49 loc) · 1.91 KB
/
checklog
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
#!/bin/bash
## A tiny little logchecker for ServerDocs Team
## Provide the JOB ID of your completed build log as an argument
## to this script, and it will output any WARNINGS or ERRORS
## that are not presently expected (i.e. new ones that you
## introduced, if any). If no errors or warning appear from
## running this script, you are clear!
## USAGE:
##
## logcheck 608050db09293ae626bc5cee
## Get build log URL as argument:
JOBID=$1
# Quit if no parameters were passed or if $BUILDLOG_URL is incomplete:
if [ -z $JOBID ]; then
echo -e "\nERROR: You must provide the Job ID as an argument."
echo -e " It can be found in the URL of your build log"
echo -e " Exiting ...\n"
exit;
elif [ `echo $JOBID | grep -Ec '^[0-9a-z]{24}$'` -lt 1 ]; then
echo -e "\nERROR: Your Job ID appears mangled."
echo -e " Example Job ID from build log:"
echo -e ""
echo -e " 608050db09293ae626bc5cee"
echo -e ""
echo -e " Exiting ...\n"
exit;
fi
# Set up local /tmp logfile path:
LOCALLOG="/tmp/buildlogcheck_$$.tmp"
# Download BUILDLOG_URL to /tmp:
node getLogs.js $JOBID > $LOCALLOG
# That ol' familiar bash field separator:
IFS="
"
# Print any WARNING or ERROR that is presently unexpected:
for LINE in `cat $LOCALLOG`; do
echo $LINE \
| grep -v '^WARNING.*Directive "only" has been deprecated$' \
| grep -v '^ERROR.*compass/manual.*.png: No such file or directory$' \
| grep -v '^ERROR.*One or more set of tabs on this page was missing.*}$' \
| grep -v '^ERROR.*Target not found: "phpmethod:phpmethod.*"$' \
| grep -v '^ERROR.*Target not found: "phpclass:phpclass.*"$' \
| grep -v '^ERROR.*Target not found: "meth:pymongo.*"$' \
| grep -v '^ERROR.*Target not found: "meth:motor.*"$' \
| grep -v '^ERROR.*Target not found: "authaction:.*"$' \
| grep -v '^INFO:snooty.main:Snooty.*starting$'
done
echo " Check complete!"
rm -f $LOCALLOG