-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathautobuild.sh
27 lines (21 loc) · 858 Bytes
/
autobuild.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
#!/bin/bash
ACCESS_TOKEN=g17h084cc351704e1
while :
do
PRS=$(curl -s https://api.github.com/repos/navcoin/navcoin-core/pulls?state=open)
DATA=$(echo $PRS|jq -r .[].head.label)
IDS=$(echo $PRS|jq -r .[].number)
arrIDS=(${IDS// / })
I=0
for pr in $DATA; do
arrPR=(${pr//:/ })
bash ~/build.sh ${arrPR[0]} ${arrPR[1]} ${arrIDS[$I]} && \
LASTCOMMIT=$(cat ~/public_html/binaries/${arrPR[1]}/.lastbuild) && \
curl -s -H "Authorization: token ${ACCESS_TOKEN}" \
-X POST -d "{\"body\": \"A new build of ${LASTCOMMIT} has completed succesfully!\nBinaries available at https://build.nav.community/binaries/${arrPR[1]}\"}" \
"https://api.github.com/repos/navcoin/navcoin-core/issues/${arrIDS[$I]}/comments"
I=$((I+1))
done
bash ~/build.sh navcoin master 0
sleep 120
done