diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f3421f..e9d586d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2024-11-18 +### Added +- When a custom `GIT_BRIDGE_IMAGE` is set, `bin/upgrade` no longer tries to pull the new version, and prompts + the user to update and tag the custom image separately. + ## 2024-10-29 ### Added - Pull new images from `bin/upgrade` ahead of stopping containers diff --git a/bin/upgrade b/bin/upgrade index 84de2fa..c5d361c 100755 --- a/bin/upgrade +++ b/bin/upgrade @@ -160,6 +160,16 @@ function handle_image_upgrade() { set_server_pro_image_name "$SEED_IMAGE_VERSION" docker pull "$IMAGE" if [[ $GIT_BRIDGE_ENABLED == "true" ]]; then + if [[ -n ${GIT_BRIDGE_IMAGE:-} ]]; then + echo "------------------- WARNING ----------------------" + echo " You're using the custom git bridge image $GIT_BRIDGE_IMAGE" + echo " Before continuing you need to tag the updated image separately, making sure that:" + echo " 1. The Docker image is tagged with the new version: $SEED_IMAGE_VERSION" + echo " 2. The config/overleaf.rc entry GIT_BRIDGE_IMAGE only contains the image name, and not a tag/version." + echo " You wont be able to continue with this upgrade until you've tagged your custom image with $SEED_IMAGE_VERSION" + echo "------------------- WARNING ----------------------" + prompt "Has the custom image been tagged?" + fi set_git_bridge_image_name "$SEED_IMAGE_VERSION" docker pull "$GIT_BRIDGE_IMAGE" fi diff --git a/lib/shared-functions.sh b/lib/shared-functions.sh index ebd7164..a35d17c 100644 --- a/lib/shared-functions.sh +++ b/lib/shared-functions.sh @@ -96,7 +96,15 @@ function set_git_bridge_image_name() { else image_name="quay.io/sharelatex/git-bridge" fi - export GIT_BRIDGE_IMAGE="$image_name:$version" + + # since we're reusing the GIT_BRIDGE_IMAGE environment variable, we check here if the version + # has already been added to it, for scenarios where this function is called more than once + if [[ "$image_name" == *"$version" ]]; then + export GIT_BRIDGE_IMAGE="$image_name" + else + export GIT_BRIDGE_IMAGE="$image_name:$version" + fi + } function check_retracted_version() {