Skip to content

Commit 268b7ab

Browse files
committed
maint: improve bootstrap resilience
Make the bootstrap initialization more resilient to errors. Relates-to: keymanapp/shared-sites#90 Test-bot: skip
1 parent 710c475 commit 268b7ab

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
# Shared files are bootstrapped:
33
resources/bootstrap.inc.sh
44
resources/.bootstrap-version
5+
resources/.bootstrap-registry
56
_common/
67

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 -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 PROXY_CONTAINER_NAME=local-proxy-website

0 commit comments

Comments
 (0)