From db72880ce1674f90f321d853ffd5106a79a2d3ff Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Sun, 15 Feb 2026 04:48:30 +0100 Subject: [PATCH] maint: improve bootstrap resilience Make the bootstrap initialization more resilient to errors. Relates-to: keymanapp/shared-sites#90 Test-bot: skip --- .gitignore | 1 + build.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9cf8e7f97..fbd356492 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ metadata/ # Shared files are bootstrapped: resources/bootstrap.inc.sh resources/.bootstrap-version +resources/.bootstrap-registry _common/ diff --git a/build.sh b/build.sh index 307ddbcf8..57a8910a8 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,11 @@ readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" readonly BOOTSTRAP_VERSION=v1.0.9 -[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh) +if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then + 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 + source "$BOOTSTRAP.tmp" + rm -f "$BOOTSTRAP.tmp" +fi ## END STANDARD SITE BUILD SCRIPT INCLUDE readonly S_KEYMAN_CONTAINER_NAME=s-keyman-website