Include GitHub response to make debugging easier, escape strings
parent
cfcb498448
commit
f69498ca99
|
|
@ -293,6 +293,8 @@ if [[ "${MINIKUBE_LOCATION}" == "master" ]]; then
|
|||
exit $result
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
# retry_github_status provides reliable github status updates
|
||||
function retry_github_status() {
|
||||
local pr=$1
|
||||
|
|
@ -307,17 +309,19 @@ function retry_github_status() {
|
|||
local code=-1
|
||||
|
||||
while [[ "${attempt}" -lt 8 ]]; do
|
||||
code=$(curl -o /dev/null -s --write-out "%{http_code}" -L \
|
||||
"https://api.github.com/repos/kubernetes/minikube/statuses/${pr}?access_token=$token" \
|
||||
local out=$(mktemp)
|
||||
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L \
|
||||
"https://api.github.com/repos/kubernetes/minikube/statuses/${pr}?access_token=${token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d "{\"state\": \"$state\", \"description\": \"Jenkins\", \"target_url\": \"$target\", \"context\": \"${context}\"}" || echo 999)
|
||||
-d "{\"state\": \"${state}\", \"description\": \"Jenkins\", \"target_url\": \"${target}\", \"context\": \"${context}\"}" || echo 999)
|
||||
|
||||
# 2xx HTTP codes
|
||||
if [[ "${code}" =~ ^2 ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
cat "${out}" && rm -f "${out}"
|
||||
echo "HTTP code ${code}! Retrying in ${timeout} .."
|
||||
sleep "${timeout}"
|
||||
attempt=$(( attempt + 1 ))
|
||||
|
|
|
|||
|
|
@ -56,17 +56,19 @@ function retry_github_status() {
|
|||
local code=-1
|
||||
|
||||
while [[ "${attempt}" -lt 8 ]]; do
|
||||
code=$(curl -o /dev/null -s --write-out "%{http_code}" -L \
|
||||
"https://api.github.com/repos/kubernetes/minikube/statuses/${pr}?access_token=$token" \
|
||||
local out=$(mktemp)
|
||||
code=$(curl -o "${out}" -s --write-out "%{http_code}" -L \
|
||||
"https://api.github.com/repos/kubernetes/minikube/statuses/${pr}?access_token=${token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d "{\"state\": \"$state\", \"description\": \"Jenkins\", \"target_url\": \"$target\", \"context\": \"${context}\"}" || echo 999)
|
||||
-d "{\"state\": \"${state}\", \"description\": \"Jenkins\", \"target_url\": \"${target}\", \"context\": \"${context}\"}" || echo 999)
|
||||
|
||||
# 2xx HTTP codes
|
||||
if [[ "${code}" =~ ^2 ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
cat "${out}" && rm -f "${out}"
|
||||
echo "HTTP code ${code}! Retrying in ${timeout} .."
|
||||
sleep "${timeout}"
|
||||
attempt=$(( attempt + 1 ))
|
||||
|
|
@ -74,6 +76,7 @@ function retry_github_status() {
|
|||
done
|
||||
}
|
||||
|
||||
|
||||
for j in ${jobs[@]}; do
|
||||
retry_github_status "${ghprbActualCommit}" "${j}" "pending" "${access_token}" \
|
||||
"https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${j}.txt"
|
||||
|
|
|
|||
Loading…
Reference in New Issue