forked from webex/webex-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntegrationTesting.sh
42 lines (37 loc) · 1.19 KB
/
IntegrationTesting.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
40
41
42
#!/bin/bash
if [ "$Email" == "" ]; then
echo "lost email address!"
exit 0
fi
if $IsIntegrationTestingTask -eq "true" ; then
echo "start Integration testing..."
sendemail -f "$Email" -t "$Email" -u "Jenkins build by Travis" -m "BranchName=$TRAVIS_BRANCH\nTravisNumber=$TRAVIS_JOB_ID\nPullRequestNumber=$TRAVIS_PULL_REQUEST" -s smtp.gmail.com:587 -o tls=yes -xu "$Email" -xp "$EmailPWD"
else
echo "not the integration test task return normal..."
exit 0
fi
sleep 60
for ((i=0; i<=25; i++)); do
buildEmailTitle=`curl -u $Email:$EmailPWD --silent "https://mail.google.com/mail/feed/atom" | 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: '/^TravisNumber:'"$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