Skip to content

Commit 1cd6aa8

Browse files
authored
Merge pull request #663 from keymanapp/maint/bootstrap-resilience
maint: improve bootstrap resilience
2 parents b4fef7d + fc60af2 commit 1cd6aa8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
44
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
55
readonly BOOTSTRAP_VERSION=v1.0.10
6-
[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -H "Cache-Control: no-cache" -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
6+
if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then
7+
curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1
8+
source "$BOOTSTRAP.tmp"
9+
rm -f "$BOOTSTRAP.tmp"
10+
fi
711
## END STANDARD SITE BUILD SCRIPT INCLUDE
812

913
readonly KEYMAN_CONTAINER_NAME=keyman-website

0 commit comments

Comments
 (0)