ci: add debug output to coverage upload step
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
752bb1d751
commit
31d36bd183
11
.drone.yml
11
.drone.yml
@ -32,11 +32,14 @@ steps:
|
|||||||
else COLOR="red"; fi
|
else COLOR="red"; fi
|
||||||
curl -sf "https://img.shields.io/badge/coverage-${PCT}%25-${COLOR}.svg" -o coverage.svg
|
curl -sf "https://img.shields.io/badge/coverage-${PCT}%25-${COLOR}.svg" -o coverage.svg
|
||||||
- |
|
- |
|
||||||
|
echo "Badge size: $(wc -c < coverage.svg) bytes"
|
||||||
SHA=$(curl -sf \
|
SHA=$(curl -sf \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
"https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg?ref=master" \
|
"https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg?ref=master" \
|
||||||
| jq -r '.sha // empty')
|
| jq -r '.sha // empty' || echo "")
|
||||||
|
echo "Existing SHA: '${SHA}'"
|
||||||
CONTENT=$(base64 -w 0 coverage.svg)
|
CONTENT=$(base64 -w 0 coverage.svg)
|
||||||
|
echo "Content length: ${#CONTENT}"
|
||||||
if [ -n "$SHA" ]; then
|
if [ -n "$SHA" ]; then
|
||||||
PAYLOAD=$(jq -n --arg msg "ci: update coverage badge [CI SKIP]" \
|
PAYLOAD=$(jq -n --arg msg "ci: update coverage badge [CI SKIP]" \
|
||||||
--arg content "$CONTENT" --arg sha "$SHA" --arg branch "master" \
|
--arg content "$CONTENT" --arg sha "$SHA" --arg branch "master" \
|
||||||
@ -46,11 +49,13 @@ steps:
|
|||||||
--arg content "$CONTENT" --arg branch "master" \
|
--arg content "$CONTENT" --arg branch "master" \
|
||||||
'{message: $msg, content: $content, branch: $branch}')
|
'{message: $msg, content: $content, branch: $branch}')
|
||||||
fi
|
fi
|
||||||
curl -fsSL -X PUT \
|
RESPONSE=$(curl -s -X PUT \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg" \
|
"https://git.cincoeuzebio.com/api/v1/repos/cinco/Tmuxido/contents/badges/coverage.svg" \
|
||||||
-d "$PAYLOAD"
|
-d "$PAYLOAD")
|
||||||
|
echo "API response: $RESPONSE"
|
||||||
|
echo "$RESPONSE" | jq -e '.content.sha' > /dev/null
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user