forked from webex/webex-ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FetchTestingResult.sh
39 lines (34 loc) · 976 Bytes
/
FetchTestingResult.sh
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
if [ "$Email" == "" ]; then
echo "lost email address!"
exit 0
fi
if $IsIntegrationTestingTask -eq "true" ; then
echo "start Fetch testing result..."
else
echo "not the integration test task return normal..."
exit 0
fi
for ((i=0; i<=25; i++)); do
buildEmailTitle=`curl -u $Email:$EmailPWD --silent "https://mail.google.com/mail/feed/atom/important" | awk -F '<title>' '{for (i=3; i<=NF; i++) {print $i"\n"}}' | awk -F '</title>' '{for (i=1; i<=NF; i=i+2) {print $i"\n"}}' | awk -F: '/^BuildNumber:'"$TRAVIS_JOB_ID"'/'`
if [ $i -eq "24" ] ; then
echo "Integration testing : TIMEOUT!"
exit 0
fi
echo "$buildEmailTitle"
if [ "$buildEmailTitle" == "" ]; then
#wait
echo "wait 60 sec"
sleep 60
else
buildResult=`echo | awk '{print test}' test="$buildEmailTitle" | awk -F: '/Fixed/||/Successful/'`
#echo "$buildResult"
if [ "$buildResult" == "" ]; then
#build failed
echo "$buildEmailTitle"
exit 1
else
echo "Jenkins build Successful!"
exit 0
fi
fi
done