Skip to content

Commit

Permalink
Rework retry against Github API
Browse files Browse the repository at this point in the history
  • Loading branch information
frzb committed Feb 13, 2019
1 parent 8b8d756 commit 01c6d1b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker/coinboot-download-helper
@@ -1,5 +1,4 @@
#!/bin/sh -e
set -x

# Copyright (C) 2018 Gunter Miegel coinboot.io
#
Expand Down Expand Up @@ -30,12 +29,13 @@ BOOTDIR=/var/lib/tftpboot
# If the value is 'latest' we determine the latest release, else we use the set value.

if [ $RELEASE = latest ]; then
while [ -n "$TAG" ]; do
RESPONSE=$($CURL --silent "https://api.github.com/repos/frzb/coinboot-debirf/tags")
echo "Github API is not returing an response, repeat ..."
sleep 5
TAG=$(echo $RESPONSE | jq -r '.[0].name')
done
while ! TAG=$(echo $RESPONSE | jq -r '.[0].name'); do
echo "Calling the Github API has failed, repeat ..."
RESPONSE=$($CURL --silent "https://api.github.com/repos/frzb/coinboot-debirf/tags")
sleep 5
done
echo "Using latest coinboot-debirf release: $TAG"
fi
URL=https://github.com/frzb/coinboot-debirf/releases/download/${TAG}
Expand Down

0 comments on commit 01c6d1b

Please sign in to comment.