-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunchTest.sh
More file actions
34 lines (29 loc) · 997 Bytes
/
launchTest.sh
File metadata and controls
34 lines (29 loc) · 997 Bytes
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
#!/bin/bash
###Get CampaignName and Cerberus Host
echo "Author: $AUTHOR";
echo "Cerberus Host: $HOST";
echo "Campaign Name: $CAMPAIGN";
###Generate Tag using Campaign Name, Commiter and UnixTimestamp
tag=$CAMPAIGN.$AUTHOR.$(date +%s)
###Run Campaign
echo "Campaign Details on : $HOST/ReportingExecutionByTag.jsp?Tag=$tag"
curl -s --request POST --url "$HOST/AddToExecutionQueueV003" -d campaign=$CAMPAIGN -d tag=$tag -H "apikey:$APIKEY"
echo
###Loop on resultCI Until end of campaign
num=1
while [ $num -lt 300 ]
do
result=$(curl -s --request POST --url "$HOST/ResultCIV004" -d tag=$tag -H "apikey:$APIKEY"| jq -r '.result')
echo "Check on Campaign ($num/300) with result : " $result
if [[ "$result" != "PE" ]]; then
break
fi
sleep 3
((num=num+1))
# echo "Campaign still running... Let's try again."
done
if [[ "$result" != "OK" ]]; then
echo "Campaign Failed. CIScore Higher than threshold !!!"
exit 1
fi
echo "Campaign Succes. Congratulation !!!"