forked from fossasia/meilix-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·32 lines (31 loc) · 1.03 KB
/
script.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
#!/bin/bash
# please mind the alternative approach suggested in https://github.com/fossasia/meilix-generator/issues/124
cat travis_tokens | while read line;
do
array=(${line})
user="${array[0]}"
project="${array[1]}"
len=${#array[@]}
for ((i=2; i<len; i++)); do
branch="${array[i]}"
body="{\"request\":{
\"branch\":\"${branch}\",
\"config\":{
\"env\":{
\"email\":\"${email}\",
\"TRAVIS_TAG\":\"${TRAVIS_TAG}\",
\"event_url\":\"${event_url}\",
\"TRAVIS_SCRIPT\":\"${TRAVIS_SCRIPT}\"
}
}
}}"
echo "Sending Data To travis To build ISO"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${KEY}" \
-d "${body}" \
"https://api.travis-ci.org/repo/${user}%2F${project}/requests"
done
done