Skip to content

Commit

Permalink
ci: Update upload logic to use new streaming support
Browse files Browse the repository at this point in the history
The file server now has a way to stream progress if the client side has
logic. This should help with 2 things:

 * better live debug
 * less 503 errors that happen due to the server taking too long to
   deliver its status code

Signed-off-by: Andy Doan <[email protected]>
  • Loading branch information
doanac committed Dec 12, 2024
1 parent 960101d commit 9de3618
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/build-yocto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,20 @@ jobs:
url="https://quic-yocto-fileserver-1029608027416.us-central1.run.app/${GITHUB_RUN_ID}/${{ matrix.machine }}/"
retries=3
okay=0
shopt -s lastpipe # allows us to capture the value of `okay` in the while loop below
for ((i=0; i<retries; i++)); do
curl -X POST -i -w '%{http_code}' --fail-with-body ${url} && break
curl -X POST -H "Accept: text/event-stream" -i --fail-with-body -s -N ${url} | \
while read line; do
echo $line
if [[ $line == STATUS=* ]]; then
if [[ $line == "STATUS=OK" ]]; then
okay=1
break
fi
fi
done
[ $okay -eq 1 ] && break
echo # new line break in case response doesn't have one
echo "Error: unable to publish artifacts, sleep and retry"
sleep 2
Expand Down

0 comments on commit 9de3618

Please sign in to comment.