1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 07:18:06 +02:00

bin/upgrade: skip downloading custom image

This commit is contained in:
mserranom 2024-11-18 11:58:09 +01:00
parent 1a4d138ade
commit 24a8feb5c7
2 changed files with 24 additions and 2 deletions

View file

@ -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

View file

@ -160,8 +160,25 @@ function handle_image_upgrade() {
set_server_pro_image_name "$SEED_IMAGE_VERSION"
docker pull "$IMAGE"
if [[ $GIT_BRIDGE_ENABLED == "true" ]]; then
set_git_bridge_image_name "$SEED_IMAGE_VERSION"
docker pull "$GIT_BRIDGE_IMAGE"
if [[ -n ${GIT_BRIDGE_IMAGE:-} ]]; then
echo "------------------- WARNING ----------------------"
echo " You're using a custom git bridge image: $GIT_BRIDGE_IMAGE"
echo " Upgrade of you're custom image is skipped. You need to pull the image separately, making sure that:"
echo " 1. The Docker image is tagged with the new version: $SEED_IMAGE_VERSION"
echo " 2. The environment variable GIT_BRIDGE_IMAGE only contains the image name, and not a tag/version."
echo " You can safely proceed with the upgrade process, but if you try subsequently to restart your instance"
echo " it will fail until the updated image with tag $SEED_IMAGE_VERSION is available in your system"
echo "------------------- WARNING ----------------------"
local should_continue="n"
read -r -p "Continue with the upgrade process? [y/n] " should_continue
if [[ ! "$should_continue" =~ [Yy] ]]; then
echo "Exiting."
exit 1
fi
else
set_git_bridge_image_name "$SEED_IMAGE_VERSION"
docker pull "$GIT_BRIDGE_IMAGE"
fi
fi
## Offer to stop docker services