提交 f69498ca 编写于 作者: T Thomas Stromberg

Include GitHub response to make debugging easier, escape strings

上级 cfcb4984
......@@ -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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册