Add 'dronefailures'
This commit is contained in:
parent
e4314af185
commit
b8f31dd12b
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
result=$(curl -X GET https://DOMAIN/api/repos/OWNER/REPO/builds -H "Authorization: Bearer YOURTOKEN")
|
||||||
|
|
||||||
|
if [ -z $1 ]
|
||||||
|
then
|
||||||
|
max_counter=3
|
||||||
|
else
|
||||||
|
max_counter=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
counter=0
|
||||||
|
echo "${result}" | jq -r '.[] | "\(.status)"' | while read status
|
||||||
|
do
|
||||||
|
if [ $status == "failure" ]
|
||||||
|
then
|
||||||
|
echo " "
|
||||||
|
echo " [ build failed! ]"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $counter -eq $max_counter ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
counter=$(($counter + 1))
|
||||||
|
done
|
Loading…
Reference in New Issue